Errors
Handle transport failures and GraphQL payload failures separately.
HTTP status handling
| Status | Meaning | Recommended handling |
|---|---|---|
400 | Malformed request or invalid argument. | Fix the request shape or variables before retrying. |
401 | Invalid credentials or expired token. | Refresh the JWT, then retry. |
403 | Caller lacks the required API permission. | Check claims and API key scope. |
404 | Wrong route or resource path. | Verify endpoint and host. |
500, 503, 504 | Transient backend or upstream failure. | Retry with exponential backoff starting at 1 second. |
GraphQL payload errors
A request can return 200 OK and still include an errors array in the response body.
Example error response
{
"errors": [
{
"message": "Field 'FakeField' not found on current context 'XyCoreContext'"
}
],
"data": {}
}
Always inspect the GraphQL response payload, even when the HTTP request succeeds.