6 GraphQL
hunterlong edited this page 2020-04-11 16:41:30 -07:00

Statping implements the GraphQL API interface so you can customize the exact data you need within a query. The GraphQL endpoint is at /graphql on your Statping instance and is only available for Authenticated users or while sending the Authorization API Secret.

View schema.graphql


Example Queries

Retrieve the id, name, and public parameters from service #2.

GraphQL Query:
{
  service(id: 2) {
    id
    name
    public
  }
}
Response:
{
  "data": {
    "service": {
      "id": 2,
      "name": "Statping Github",
      "public": true
    }
  }
}

GraphQL Integration Checklist

  • Core (read)

  • Services (read)

  • Groups (read)

  • Users (read)

  • Messages (read)

  • Failures (read)

  • Checkins (read)

  • Core (update)

  • Services (update/create)

  • Groups (update/create)

  • Users (update/create)

  • Messages (update/create)

  • Failures (update/create)

  • Checkins (update/create)


The code for handling GraphQL requests is in handlers/graphql and is using gqlgen to automatically generate the schema based on the golang structs.