-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: router HTTP response status codes (#4733)
Document router response status codes in [new errors page](https://deploy-preview-4733--apollo-router-docs.netlify.app/errors) Resolves #4740 and https://apollographql.atlassian.net/browse/DOC-34 --------- Co-authored-by: Jesse Rosenberger <[email protected]> Co-authored-by: Maria Elisabeth Schreiber <[email protected]>
- Loading branch information
1 parent
c0d98f2
commit ddb8b0a
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
title: Errors | ||
subtitle: Error and status codes returned by the Apollo Router | ||
description: Error codes and HTTP response status codes returned by the Apollo Router | ||
--- | ||
|
||
Learn about error codes and HTTP response status codes returned by the Apollo Router. | ||
|
||
## Status codes | ||
|
||
<PropertyList kind="errCodes"> | ||
<Property name="400" short="Bad request"> | ||
|
||
A request failed GraphQL validation or failed to be parsed. | ||
|
||
</Property> | ||
<Property name="401" short="Unauthorized"> | ||
|
||
Requests may receive this response in two cases: | ||
|
||
- For a client request that requires authentication, the client's JWT failed verification. | ||
- For a non-client subscription endpoint calling a subscription callback URL, the router couldn't find a matching subscription identifier between its registered subscriptions and a subscription event. | ||
|
||
</Property> | ||
<Property name="405" short="Method not allowed"> | ||
|
||
A request used an unallowed HTTP method. | ||
|
||
<Note> | ||
|
||
Both mutations and subscriptions must use POST. | ||
|
||
</Note> | ||
|
||
</Property> | ||
<Property name="406" short="Not acceptable"> | ||
|
||
A request's HTTP `Accept` header didn't contain any of the router's supported mime-types: | ||
- `application/json` | ||
- `application/graphql-response+json` | ||
- `multipart/mixed;deferSpec=20220824` | ||
- `multipart/mixed;subscriptionSpec=1.0`. | ||
|
||
</Property> | ||
<Property name="429" short="Too many requests"> | ||
|
||
Request traffic exceeded configured rate limits. See [client side traffic shaping](/configuration/traffic-shaping/#client-side-traffic-shaping). | ||
|
||
</Property> | ||
<Property name="500" short="Internal server error"> | ||
|
||
The router encountered an unexpected issue. [Report](https://github.com/apollographql/router/issues/new?assignees=&labels=raised+by+user&projects=&template=bug_report.md&title=) this possible bug to the router team. | ||
|
||
</Property> | ||
</PropertyList> | ||
|
||
<Note> | ||
|
||
You can create Rhai scripts that throw custom status codes. See [Terminating client requests](/customizations/rhai-api#terminating-client-requests) to learn more. | ||
|
||
</Note> |