Graphql query to get the Delegate status

Below query will list all the delegate(max=100 per query and need to set offset or pagination if you have more than 100 delegate):

 {
  delegateList(limit: 100) {
    nodes {
      delegateName,
      hostName,
      ip,
      lastHeartBeat,
      version,
      connections{
        disconnected,
        version
      }
    }
  }
}

So this lists all the delegate, and the connected delegate output will have disconnected:true

"connections": [
            {
              "disconnected": false,
              "version": "1.0.74007"
            }

While the delegates which are not connected will return an empty connections property something like below:

`"connections": [] `

Here is the complete response for one of such delegate:
{
"delegateName": "delname",
"hostName": "host",
"ip": "192.0.0.1",
"lastHeartBeat": "1646207503448",
"version": "1.0.74007",
"connections": [] },

1 Like