Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposing user-friendly errors from subgraphs without exposing internal information #6358

Open
yanns opened this issue Nov 29, 2024 · 0 comments

Comments

@yanns
Copy link
Contributor

yanns commented Nov 29, 2024

Is your feature request related to a problem? Please describe.

This is related to a recent change: #6191
We have a GraphQL service that is using business logic to expose user-friendly errors.
When moving to GraphQL federation, we want to keep those user-friendly errors, but I cannot find a good way to do so right now.
By default, error message are redacted.
If I activate include_subgraph_errors, then the router will expose too much information, like:

  • adding a SUBREQUEST_HTTP_ERROR error
  • adding the subgraph information in service (PR)

I cannot find a good way to tell the router to use the subgraph errors without adding internal information.

Describe the solution you'd like

We could have a flag to tell the router to only propagate subgraph errors, without adding more internal information.
Actually we could use include_subgraph_errors for that and add a sub-configuration to tell the router to add internal information.

Describe alternatives you've considered

Currently, we are using include_subgraph_errors, and we transform the error responses with one plugin.
First we were removing only the SUBREQUEST_HTTP_ERROR errors.
Now we need to also remove the added service field in the error extension.
I think we need a more straightforward solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant