Skip to content

Return custom HTTP status codes #1874

Answered by dariuszkuc
rb090 asked this question in General
Discussion options

You must be logged in to vote

Hello 👋
In general, as long as GraphQL server can resolve your request and respond with well formed response then the return status should be 200. There are number of great talks/blog posts that cover this topic - I highly recommend to check out Guide to GraphQL Errors by Marc-Andre and 200 OK! talk from Sasha.

As an FYI, there is a draft spec for implementing GraphQL over HTTP that attempts to add back some of the status codes back to the responses -> https://graphql.github.io/graphql-over-http/draft. It introduces new application/graphql-response+json media type that allows you to specify custom status code and "should" become the "standard" starting Jan 1st 2025. Until then the standar…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by rb090
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1873 on October 28, 2023 20:55.