Query batching
Sleuth GQL API supports batching, which allows you to execute multiple queries in a single request. To use it, you need to make two small changes to your requests: use a different API URL and wrap the payload in a list.
The two examples below demonstrate the same query being requested individually or in a batch.
https://app.sleuth.io/graphql
{
"query": "{ organization(orgSlug: \"sleuth\") { name } }",
"variables": null
}
https://app.sleuth.io/graphql-batch
[
{
"query": "{ organization(orgSlug: \"sleuth\") { name } }",
"variables": null
}
]
When batching queries, the server response will match the request and return a list of objects instead of a single object.
Last modified 7mo ago