Skip to content

Commit

Permalink
docs: router HTTP response status codes (#4733)
Browse files Browse the repository at this point in the history
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
3 people authored Mar 12, 2024
1 parent c0d98f2 commit ddb8b0a
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
]
},
"Debugging": {
"Errors": "/errors",
"Telemetry": "/configuration/telemetry/overview",
"Subgraph error inclusion": "/configuration/subgraph-error-inclusion"
},
Expand Down
61 changes: 61 additions & 0 deletions docs/source/errors.mdx
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>

0 comments on commit ddb8b0a

Please sign in to comment.