Open patrick91 opened 1 year ago
I'm somewhat critical of setting the http status right in the base GraphQL error, as the Schema is transport-agnostic. Maybe we can create a new Http or StatusCode GraphQLError with a middleware for the HTTP/Websocket/(in the future SSE) views that injects the code based on the new Error class.
Discussed in https://github.com/strawberry-graphql/strawberry/discussions/2304
Apollo server allows errors to change the status code, maybe we can do the same:
https://www.apollographql.com/docs/apollo-server/data/errors/#setting-http-status-code-and-headers
Upvote & Fund