Open xuorig opened 1 year ago
@xuorig Is it possible for you to use a rhai script to convert the errors into the format that you'd like?
@BrynCooke it's possible, and it is our current workaround (RouterService plugin rather than rhai).
The problem is that this requires us to deal with untyped structures and match against String codes. Longer term this would be too brittle to handle.
A translation abstraction between router (Fetch and Planning errors) and graphql errors would be very useful!
We've made fairly decent progress, I suspect a PR to open within 2 weeks.
I'm going to fix CI and mark https://github.com/apollographql/router/pull/4131 as ready for early review
Our GraphQL errors have a particular format that differs from the router's defaults. (https://netflix.github.io/dgs/error-handling/#the-typederror-interface)
Most of the time, these errors are simply returned from subgraphs. However, in the case of a
FetchError
, the router itself should format the error in a similar manner.Currently, the router defines the FetchError enum and also controls how these errors are mapped the the final graphql error, including extensions.
In our subgraph service, we'd like the ability to do two things:
FetchError