Errors

The Grafbase gateway only the returns the following HTTP status codes:

HTTP Status codeDescription
200GraphQL response is returned
400Invalid request, ex: invalid JSON
500Internal server error

All GraphQL errors that may be returned will have an error code in extensions:

Error CodeDescription
BAD_REQUESTBad request
INTERNAL_SERVER_ERRORInternal server error
TRUSTED_DOCUMENT_ERRORTrusted document could not be loaded or doesn't exist
PERSISTED_QUERY_ERRORAutomatic persisted query failed
PERSISTED_QUERY_NOT_FOUNDAutomatic persisted query was not found and must be provided
SUBGRAPH_ERRORGraphQL error coming from the subgraph
SUBGRAPH_INVALID_RESPONSE_ERRORSubgraph returned an invalid response
SUBGRAPH_REQUEST_ERRORRequest to the subgraph failed
UNAUTHENTICATEDUser is not authenticated
UNAUTHORIZEDUser is not authorized
OPERATION_PARSING_ERROROperation parsing failed
OPERATION_VALIDATION_ERROROperation validation failed
OPERATION_PLANNING_ERROROperation planning failed
HOOK_ERRORHook failed or returned an error
RATE_LIMITEDRequest was rate limited
GATEWAY_TIMEOUTRequest execeed the global timeout

Hooks can override the error code by specifying one in the code extension field of the GraphQL error they emit.

Was this page helpful?