Skip to content

Querying the database through Check API

Daniela Feitosa edited this page Jun 1, 2020 · 13 revisions

Please note that this page is a work in progress, with some content and links missing

Before starting with queries, read about Authentication and authorization on Check API


Check API data can be retrieved using GraphQL, a query language that returns only the data requested by the client and provides a full description of API data model. For those who are not familiar with GraphQL, this link can give an overview about how to query a GraphQL server: https://graphql.org/learn/queries/

GraphQL web interface

Check API has a web interface where users can test GraphQL queries and mutations.

If you are Running Check locally an API key with the token dev was created by default. This token allows you to manage everything in your workspace.

To have access to the GraphQL interface:

  1. In your local environment, access: https://localhost:3000/graphiql
  2. Add the token on the field API key on top of the page
  3. Click on "Set API key" to authenticate yourself.

After authenticating you can use the web interface to query CheckAPI and manage all the content your token allows you to access.

In the left pane you can add the queries and mutations using the autocomplete function. Just start typing and it will list some suggestions according to the data model. To start using, copy and paste the query below:

query {
  about {
    name
  }
}

Clicking on the "play" button you'll get the response in the right pane. The response to the query above should be

{
  "data": {
    "about": {
      "name": "Check"
    }
  }
}

By clicking on "Docs" on top right of the page you can see the documentation and browse the schema and its description. All the Types, Queries and Mutations are listed there. Use it as reference when describing a query.

GraphQL query examples

TODO

Additional reading: