graphql
GraphQL Error Codes
String codes returned in the extensions.code field of GraphQL error responses. The GraphQL specification defines error categories for parse and validation failures; Apollo Server and graphql-js extend this with additional well-known codes for authentication, authorisation, and request handling.
11 codes
· All codes 11 codes
- BAD_REQUEST Bad Request The HTTP request itself is malformed in a way that prevents GraphQL processing from starting — for example, a missing or unparseable request body, an unsupported content type, or a request that violates the GraphQL over HTTP specification.
- BAD_USER_INPUT Bad User Input A resolver received argument values that are invalid for the operation — such as a malformed identifier, a value outside an accepted range, or a type coercion failure. Equivalent to an HTTP 400 for argument-level problems.
- FORBIDDEN Forbidden The request is authenticated but the caller does not have permission to access the requested field or resource. Unlike UNAUTHENTICATED, re-authenticating will not resolve the error.
- GRAPHQL_PARSE_FAILED GraphQL Parse Failed The GraphQL document submitted in the request could not be parsed as valid GraphQL syntax. This is a request error as defined by the GraphQL specification; no data is returned.
- GRAPHQL_VALIDATION_FAILED GraphQL Validation Failed The GraphQL document is syntactically valid but fails schema validation — for example, it references fields or types that do not exist in the schema. This is a request error as defined by the GraphQL specification; no data is returned.
- INTERNAL_SERVER_ERROR Internal Server Error An unexpected error occurred during execution and no more-specific code applies. Apollo Server uses this as the default code for unhandled exceptions, masking internal details from the client in production.
- NOT_FOUND Not Found The requested resource or entity could not be found. Resolvers throw this code when a lookup by identifier returns no result.
- OPERATION_RESOLUTION_FAILURE Operation Resolution Failure The server could not determine which operation to execute from the provided document — for example, the document defines multiple operations and no operationName was specified, or the specified operationName does not match any operation in the document.
- PERSISTED_QUERY_NOT_FOUND Persisted Query Not Found The client sent an Automated Persisted Query (APQ) request containing only a query hash, but the server's APQ cache does not contain a document registered under that hash. The client should retry with the full query document.
- PERSISTED_QUERY_NOT_SUPPORTED Persisted Query Not Supported The client sent an Automated Persisted Query (APQ) request, but the server is configured to reject APQ requests entirely. The client should send the full query document instead.
- UNAUTHENTICATED Unauthenticated The request requires authentication credentials that were not provided or that could not be verified. The client should authenticate and retry the request.