Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Allow custom handling of runtime query errors #780

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MatthiasKunnen
Copy link
Contributor

@MatthiasKunnen MatthiasKunnen commented Sep 15, 2021

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.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 15, 2021

CLA Signed

The committers are authorized under a signed CLA.

@justinmchase
Copy link

I am strongly in favor of this, I definitely need to be able to customize the error code.

@MatthiasKunnen
Copy link
Contributor Author

MatthiasKunnen commented Aug 4, 2022

Also closes #808

@mihairadulescu
Copy link

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 !

@saihaj
Copy link
Member

saihaj commented Feb 14, 2023

This package is deprecated. You can read more here #817

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants