Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

GraphQLError

Raised when a GraphQL response carries a non-empty errors array, or is missing both data and errors.

Definition

class GraphQLError(Error):
    """Raised when a GraphQL response carries a non-empty `errors` array."""

When it fires

The HTTP layer succeeded (2xx, valid JSON object envelope) but the query failed at the GraphQL layer. The message concatenates every error's message with its path:

GraphQLError: invalid pair_id 'perp/xyzusd' (path=['queryApp', 'wasm_smart'])

Also raised when the envelope is missing both data and errors — a server-side malformation.

Example

from dango.utils.error import GraphQLError
 
try:
    info.query_app({"wasm_smart": {"contract": "0xdead", "msg": {}}})
except GraphQLError as exc:
    print("query failed:", exc)

See also