@apollo/gateway overrides downstream service error codes with DOWNSTREAM_SERVICE_ERROR in executeQueryPlan.ts. It does so on purpose and I assume there is a good reason for doing so. We’d like for downstream service error codes and messages to surface up instead of this DOWNSTREAM_SERVICE_ERROR, and I’m thinking we could do it with a formatError function by looking at the originalError if available and using the code and message from it.

So, what is the rationale for overriding service errors with DOWNSTREAM_SERVICE_ERROR, and would there be any reason why surfacing service errors not be a good idea?



1 Like

It turns out I had misunderstood the behaviour in executeQueryPlan.ts , the code is only overridden with DOWNSTREAM_SERVICE_ERROR when it is not found in the extensions . So everything works as expected from a gateway perspective. The problem was on our end.