apolloapi-v2/src/graphql/graphqlModules/Node/NodeStats.js
2020-03-07 19:30:13 -05:00

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')
}
}
}