graphql/express-graphql

Publish new version of express-graphql

andrehsu opened this issue · 4 comments

@IvanGoncharov, is it possible to release a new version of express-graphql containing all the latest commits? Specifically, I want to use the features implemented in PR #696.

acao commented

I can look into that today!

acao commented

I don't have permissions for this project on npm, perhaps @IvanGoncharov or @brianwarner can help me with this?

acao commented

@andrehsu we have reverted this PR as it diverges from the transport spec. if you would like to have different error response codes, you'll want to take that up with the graphql-over-http transport spec WG!

@acao I've read the GraphQL Over HTTP spec, and I don't understand why the commit was reverted.

Right now, the status code is always 500 for errors, when more appropriate status codes might be 400 for malformed requests, 401 for unauthenticated requests, 429 for too many requests, etc.

If you read here, the spec just says that a successful response MUST be 2xx, and it SHOULD be 200. In fact, it says that "in case of errors that completely prevent the successful execution of the request, the server SHOULD respond with the appropriate status code depending on the concrete error condition."

Could you please clarify your interpretation of the spec and why that precludes handleRuntimeQueryErrorFn from setting the status code to 4xx codes?