Skip to content

Commit 1f44004

Browse files
authored
Update docs/source/data/errors.mdx
1 parent 2055d60 commit 1f44004

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/source/data/errors.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,8 @@ The REDACTED doesn't have sufficient privileges.
609609
GraphQL, by design, does not use the same conventions from REST to communicate via HTTP verbs and status codes. Client information should be contained in the schema or as part of the standard response `errors` field. We recommend using the included [Error Codes](#built-in-error-codes) or [Custom Errors](#custom-errors) for error consistency rather than directly modifying the HTTP response.
610610

611611
Apollo Server uses different HTTP status codes in various situations:
612-
- If Apollo Server has not properly started up or is in the process of shutting down, use status code 500. (The former only happens if you're using a serverless integration instead of `await`ing `startStandaloneServer(server)` or `server.start()`; the latter only happens if you have not properly set up draining for your non-standalone integration.)
612+
- If Apollo Server hasn't correctly started up or is in the process of shutting down, it responds with a 500 status code.
613+
- The former can happen if you use a serverless integration and it sends requests to an Apollo Server instance that had an error on startup. The latter happens if you aren't properly [draining your server](/apollo-server/api/plugin/drain-http-server/#using-the-plugin).
613614
- If Apollo Server can't parse the request into a legal GraphQL document and validate it against your schema, it responds with a 400 status code. This can also happen with other request problems, such as if a client attempts to send a batched HTTP request when `allowBatchedHttpRequests` isn't enabled or if CSRF prevention blocks a request.
614615
- If a request uses an invalid HTTP method (`GET` with a mutation, or any HTTP method other than `GET` or `POST`), then Apollo Server responds with a 405 status code.
615616
- If your `context` function throws, Apollo Server responds with a 500 status code.

0 commit comments

Comments
 (0)