-
API Explorer
- Custom Functions
- Logs
- SQL Playground
- docs
- api explorer
- graphql api
- queries
- combining queries
Combining Queries
You can combine multiple queries into a single request. If multiple queries are combined into a single request, they get executed in parallel, the responses are collated and returned as a single response object. This lets you fetch objects of different and unrelated types in the same query.
In the following examples, we have 2 tables called students and cities, which contains fields and relations like firstName, nameCity.
Request
query MyQuery1 { students( filter: { firstName: { equals: "James" } } ) { count items { id firstName } }
citiesById(id: "e14638cb-6d72-4a36-b30f-9b763136a7bb") { id nameCity }}Response
{ "data": { "students": { "count": 1, "items": [ { "id": "287cff0a-345b-4cca-9e9a-75a2161238fd", "firstName": "James" } ] }, "citiesById": { "id": "e14638cb-6d72-4a36-b30f-9b763136a7bb", "nameCity": "Chicago" } }}