router icon indicating copy to clipboard operation
router copied to clipboard

docs: Define HTTP status codes

Open abernix opened this issue 1 year ago • 0 comments

We should document these HTTP status codes somewhere, but for now, an issued is better than nothing!

Current Understanding

  • 400 Bad Request: could be a graphql validation issue, or any issue when parsing the http request
  • 401 Unauthorized: returned by the authorization plugin to clients or returned by the subscription endpoint when trying to send an event to a non-existent subscription or when having an invalid hash
  • 405 Method Not Allowed: returned when a mutation comes in with an HTTP method other than POST or when not using POST on the subscription endpoint
  • 406 Not Acceptable: when a query comes in with an Accept header the router does not support (e.g., different from application/json, application/graphql-response+json, multipart/mixed;deferSpec=20220824 or multipart/mixed;subscriptionSpec=1.0.
  • 500 Internal Server Error: This could be a status code set explicitly by plugins, but it's best to check the logs. It could also be a bug. In the event of a suspected bug, please open an issue on the router repository with a reproduction!

abernix avatar Mar 04 '24 14:03 abernix