Raster

Errors

How the GraphQL API reports failures — the errors array, the extensions shape, and the shared error-code reference.

When a request fails, the GraphQL API reports it in the standard GraphQL errors array. Each entry carries a human-readable message plus, under extensions, a machine-readable code and the HTTP status the same failure returns over REST.

The error shape

A failed operation comes back with one or more entries in errors and a null (or partial) data:

{
  "errors": [
    {
      "message": "API key not authorized for this library.",
      "extensions": {
        "code": "API_KEY_NOT_AUTHORIZED_FOR_LIBRARY",
        "http": { "status": 404 }
      }
    }
  ],
  "data": null
}
  • message — a human-readable string safe to surface to end users.
  • extensions.code — the stable, machine-readable failure mode. Dispatch on this.
  • extensions.http.status — the HTTP status the same coded error returns over REST.

The transport-level HTTP response carries the same status as extensions.http.status, and the code and message match what REST returns for the same failure — dispatch on whichever your client already handles.

Error codes

Every code, its message, and the HTTP status it maps to is defined in the canonical reference. A given failure produces the same extensions.code, message, and extensions.http.status over GraphQL as it does over REST:

On this page