1 of 20
2 of 20
3 of 20
4 of 20
5 of 20
6 of 20
7 of 20
8 of 20
9 of 20
10 of 20
11 of 20
12 of 20
13 of 20
14 of 20
15 of 20
16 of 20
17 of 20
18 of 20
19 of 20
20 of 20

doc

Queries GraphQL API

Queries are the starting point to begin consulting information as you use a query to request information from a database. The GraphQL API relies on queries to fetch values and send the requested data as a response with a similar format in a JSON file.

The use of queries enables requesting and fetching specific data. This means you can get a response to your request even with a small query if you don’t want to see data that isn’t essential at that moment. Using queries also means you get faster responses, as the GraphQL API doesn’t need to fetch unnecessary amount of data.

Queries also make it easier for you to add or delete information from your request. For example, if you request data for httpMetrics:

query HttpQuery {
  httpMetrics(
    limit: 2
    filter: {
      tsRange: {begin:"2022-10-20T10:10:10", end:"2022-10-23T10:10:10"}
    }
  ) 
  {	
    ts
    sourceLocPop
    requests
  }
}

And decide you want to add idnsQueriesMetrics to your request, you can add a similar query, only changing the dataset you want to fetch, and run another request:

query IdnsQuery {
  idnsQueriesMetrics(
    limit: 2
    filter: {
      tsRange: {begin:"2022-10-20T10:10:10", end:"2022-10-23T10:10:10"}
    }
  ) 
  {	
    ts
    sourceLocPop
    requests
  }
}

By using queries, your requests and responses also become more organized. Due to GraphQL’s ability to adapt, you can make several calls to the API and still receive only the data you requested in an organized JSON result.

Using the GraphQL API and its features also improve your performance.


Didn’t find what you were looking for? Open a support ticket.