docs/http.md
Mercurius exhibits the following behaviour when serving GraphQL over HTTP.
Mercurius has the following default behaviour for HTTP Status Codes.
When a GraphQL response contains data that is defined, the HTTP Status Code is 200 OK.
200 OK!== nullN/AWhen a GraphQL input document is invalid and fails GraphQL validation, the HTTP Status Code is 400 Bad Request.
400 Bad RequestnullMER_ERR_GQL_VALIDATIONWhen a GraphQL response contains errors, the HTTP Status Code is 200 OK as defined in the GraphQL Over HTTP
Specification.
200 OKnullArray<GraphQLError> (.length >= 1)statusCode propertyWhen a GraphQL response contains a single error with the statusCode property set and no data, the HTTP Status Code is set to this value. See ErrorWithProps for more details.
Error statusCodenullArray<GraphQLError> (.length === 1)If you wish to customise the default HTTP Status Code behaviour, one can do this using the errorFormatter option.