Errors

Errors come in two layers on the query path. The billing gate in front of a Host's GraphQL endpoint rejects requests with a plain HTTP status and a plain text message. Requests that get past it can still fail inside GraphQL, and those failures arrive in the standard GraphQL error envelope. This page covers both, plus the statuses added by a network gateway deployment.

Billing gate rejections (Host)

A Host client gates /api/v0/graphql with the billing middleware. When it rejects a request, the response body is plain text, not JSON:

HTTP/1.1 403 Forbidden
Content-Type: text/plain; charset=utf-8

forbidden: stale or future request
StatusMessageCause
400bad graphql requestThe request could not be parsed as a GraphQL request at all.
400a billed query may touch only one viewThe query selects more than one View collection, and a billed query maps to one pool.
403forbidden: missing request signatureThe extensions envelope is absent or carries no request_signature.
403forbidden: stale or future requestrequest_timestamp is outside the two-minute freshness window around the Host's clock.
403forbidden: request verification failedThe signature does not verify, or the query does not match the signed query_hash.
403forbidden: query names no poolpool_address is missing or is the zero address.
402payment required: insufficient query balanceThe signer's query balance is below the Host's minimum.
503authorization backend unavailableThe Host could not reach its authorizer. Retry, and report it if it persists.
503view metadata unavailableA registered View is missing its on-chain address, and the Host fails closed rather than serve it unverified.

The envelope and the signing flow it requires are covered in Connect your app to a Host and Query your first View. The freshness window is two minutes by default, so sign the envelope right before you send it, and treat repeated stale or future request rejections as clock skew between your machine and the Host.

GraphQL errors

A request that passes the gate can still fail inside GraphQL: an unknown field, a malformed filter, a collection that does not exist. These arrive in the standard GraphQL error envelope:

{
  "errors": [
    {
      "message": "..."
    }
  ]
}

A response can carry data and errors together, so check for errors before trusting data. Which HTTP status accompanies the envelope depends on the server and the negotiated content type, so parse the body rather than the status line for anything that got past the billing gate.

Network gateway statuses

A network gateway deployment sits in front of several Hosts and returns the agreed answer. When it rejects a request itself, these statuses appear:

StatusWhen
400The query fails parse or validation, when the client negotiated application/graphql-response+json. With plain application/json these come back as 200 with an errors body, per the GraphQL-over-HTTP spec.
406The Accept header matches no supported content type.
413The request body exceeds 64 KiB.
415The request Content-Type is not application/json.
500An internal failure marshaling the response.
502Every sampled Host failed, or a Host returned an unparseable response.
503No Host serves the requested collection, or the query spans multiple root collections.

The parse and validation messages a gateway returns are: empty GraphQL query, GraphQL parse error, validation failed, limit not specified, invalid limit, order not specified, invalid order, and unsupported root selection. The last three reflect the gateway's query contract: every root field needs a limit and an order, and fragments at the root of a query are not supported.

Generator schema endpoint

The Generator's schema endpoints reject unauthenticated calls with a JSON envelope, {"error": "<code>", "message": "<text>"}, on /api/v1/*:

StatusCodeCause
401unauthorizedNo credentials supplied.
403forbiddenThe supplied key is not accepted.
404not_foundUnknown collection name on /api/v1/schema/{collection}.
500internal_errorUnexpected authentication failure.
503service_unavailableThe Generator is in token mode but has no keys configured.

See Primitives for the endpoints themselves.

When a Host will not answer

On a testnet, registered endpoints go stale as Hosts come and go. If a Host times out or its connection fails, pick another registered Host and try again; Query your first View shows the fallback loop. For operational symptoms on the infrastructure side, see Troubleshooting.