Allow custom handling of runtime query errors
Closes #427. Closes #808.
Why
When runtime errors occur, tracing and logging is paramount to discern between incorrect user input or a faulty backend/frontend. To this end, tracing info can be added to response headers in order for proxies/frontends to log this error and update metrics.
Without this PR, achieving this goal is only possible using dirty solutions such as hijackresponse since express-graphql finalizes the response which prevents later middleware from enhancing it.
The committers are authorized under a signed CLA.
- :white_check_mark: Matthias Kunnen (3a1ee00655aa8ea8a9224f5b8684392f03d30c54)
I am strongly in favor of this, I definitely need to be able to customize the error code.
Also closes #808
What can we do to fix this? and have it in production ? Is there anything we can do to allow GraphQL specs 200 status code for error returning? This is fucking all clients , especially apollo client you cannot read body from the response !
This package is deprecated. You can read more here https://github.com/graphql/express-graphql/pull/817