For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

GraphQL

Technical contract for GraphQL schema access and execution.

Query the semantic layer with GraphQL and receive GraphQL-shaped results inline. Unlike the other Query endpoints, this one normally responds synchronously.

For a full request/response walkthrough, including variables and response validation, see the Semantic GraphQL recipe in Consume.


Execute GraphQL query

API endpoint: POST /api/v1/query/semantic/graphql

Description: Query the semantic layer using GraphQL and receive results inline. Use it for GraphQL-native clients that want a nested response shaped by the selection set.

GraphQL normally returns the completed response synchronously. Do not start a separate statement polling workflow unless the response indicates execution is still in progress.

Key query params:

Parameter
Default
Description

retry_on_recent_failure

false

Retry even if an identical query failed recently.

Request body:

{
  "query": "query { table(limit: 10) { orders { store_region total_revenue } } }"
}

cURL:

curl -s -X POST https://$BASE_URL/api/v1/query/semantic/graphql \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query { table(limit: 10) { orders { store_region total_revenue } } }"
  }'

Example success response:

Returns: 200 OK returns GraphQL data and execution metadata. GraphQL validation or resolver failures can also use HTTP 200 OK with a top-level errors array, so clients must inspect the body. 202 Accepted with Retry-After means processing continues; safely retry the same query.

Errors:

  • 503 Service Unavailable: An upstream connection failed.

  • 504 Gateway Timeout: The upstream GraphQL service did not respond within the configured timeout.


504 Timeout and Resubmit

A 504 does not abort the underlying warehouse query; it continues running in the background regardless of the timeout. Resubmitting the same GraphQL query after a back-off is safe:

  • If the original warehouse query is still running, it is deduplicated (AWAIT_PRIMARY). The resubmit waits for the original result; the warehouse query does not execute twice.

  • If it already completed, the prior result is served immediately (REUSE_RESULT).

No statement ID is needed to resubmit. If timeouts recur despite retries, simplify the query (fewer fields, narrower time ranges) or contact the Data Product owner.

Last updated

Was this helpful?