Closed danielvladco closed 4 years ago
I figured a potential fix for this:
you need to convert the error form the remote to GraphQLError
/src/schema.ts
// ....
link = onError(({response}) => {
response.errors = response.errors.map(err =>
new GraphQLError(err.message, null, null, err.locations, err.path, null, err.extensions))
}).concat(link)
const schema = await introspectSchema(link);
return makeRemoteExecutableSchema({
schema,
link
});
//...
Hi @danielvladco 👋! Thanks for reporting. This would make sense. Would you mind testing it on graphql/gateway:feature/add-graphqlerror-support
image as I don't have any running api with error extensions?
Moved to apollo federation should mitigate this issue
Hi thanks for the great work and
graphql/gateway
docker image.When I use the gateway to forward requests to other services for some reason in case of error my extensions are missing:
For example when my graphql field is expected to return an error I usually have this json:
Notice in extensions I have 2 more fields for additional information about the error. However when my request goes through the gateway it's missing these extensions. Example:
The image with tag is
graphql/gateway:latest
Could you please look into this issue?
Thanks, Daniel