GraphQL queries and mutations require different error handling.
null
, that typically indicates that the entity is not found (equivalent to an HTTP 404 in a REST API).
The list of error extensions that can be returned by queries:
GRAPHQL_PARSE_FAILED
: The GraphQL operation string contains a syntax error. The request should not be retried.GRAPHQL_VALIDATION_FAILED
: The GraphQL operation is not valid against the schema. The request should not be retried.BAD_USER_INPUT
: The GraphQL operation includes an invalid value for a field argument. The request should not be retried.UNAUTHENTICATED
: The API key is invalid. The request should not be retried.FORBIDDEN
: The API key is unauthorized to access the entity being queried. The request should not be retried.INTERNAL_SERVER_ERROR
: An internal error occurred. The request should be retried. If this error persists, please get in touch at help@plain.com and report the issue.Output
type that follow a consistent pattern of having two optional fields,
one for the result and one for the error. If the error is returned then the mutation failed.
MutationError
has the following fields (assuming you included all these fields in your query):
VALIDATION
, FORBIDDEN
, INTERNAL
.
VALIDATION
means input validation failed. See the fields for details on why the input was invalid.FORBIDDEN
means the user is not authorized to do this mutation. See message
for details on which permissions are missing.INTERNAL
means an unknown internal server error occurred. Retry in this scenario and contact help@plain.com if the error persists.VALIDATION
, REQUIRED
, NOT_FOUND
.
VALIDATION
means the field was provided, but didn’t pass the requirements of the field. See the message
on the field for details on why.REQUIRED
means the field is required. String inputs may be trimmed and checked for emptiness.NOT_FOUND
means the input field referenced an entity that wasn’t found. For example, you tried to resolve an issue that doesn’t exist/was deleted.