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

feat(federation): Include originalError in downstreamServiceError #309

Merged
merged 8 commits into from
Jan 5, 2021

Conversation

coryvirok
Copy link
Contributor

 new ApolloServer({
  formatError: GraphQLError => GraphQLError.originalError, // undefined
  gateway: new ApolloGateway({ ... })
  ...
})

The GraphQLError type expected to have originalError (if avialible)
formatError: GraphQLError => GraphQLError.originalError

In the event of a downstreamServiceError, it does not include the original error.
I believe it's reasonable to expect the original error in this event.


Originally at: apollographql/apollo-server#3211

@apollo-cla
Copy link

@coryvirok: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@coryvirok
Copy link
Contributor Author

Originally apollographql/apollo-server#3211 but it looks like the author hasn't created the PR in this repo yet and this is a pretty important feature to help debug downstream errors.

@bl42 I'm happy to close this if you want to open a new PR and retain authorship. Otherwise, I'd love to see this change make its way into main.

gateway-js/src/executeQueryPlan.ts Outdated Show resolved Hide resolved
@trevor-scheer trevor-scheer changed the title federation: Include originalError in downstreamServiceError feat(federation): Include originalError in downstreamServiceError Jan 5, 2021
@trevor-scheer trevor-scheer merged commit 6ceea35 into main Jan 5, 2021
@trevor-scheer trevor-scheer deleted the apollo-server-import/pr-3211 branch January 5, 2021 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants