mirror of
https://github.com/Retropex/apolloapi-v2.git
synced 2025-06-02 15:32:30 +02:00
35 lines
525 B
JavaScript
35 lines
525 B
JavaScript
module.exports.typeDefs = `
|
|
type NodeActions {
|
|
stats: NodeStatsOutput!
|
|
}
|
|
|
|
type NodeStatsOutput {
|
|
result: NodeStatsResult
|
|
error: Error
|
|
}
|
|
|
|
type NodeStatsResult {
|
|
stats: NodeStats!
|
|
}
|
|
|
|
type NodeStats {
|
|
timestamp: String!
|
|
blockCount: Int
|
|
connectionCount: Int
|
|
peerInfo: [PeerInfo!]
|
|
}
|
|
|
|
type PeerInfo {
|
|
addr: String
|
|
subver: String
|
|
}
|
|
`
|
|
|
|
module.exports.resolvers = {
|
|
NodeActions: {
|
|
stats (root, args, { dispatch }) {
|
|
return dispatch('api/node/stats')
|
|
}
|
|
}
|
|
}
|