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

GraphQLExtension.didEncounterErrors with context or requestContext #2702

Closed
morris opened this issue May 21, 2019 · 2 comments
Closed

GraphQLExtension.didEncounterErrors with context or requestContext #2702

morris opened this issue May 21, 2019 · 2 comments

Comments

@morris
Copy link

morris commented May 21, 2019

Feature request: GraphQLExtension.didEncounterErrors could receive the current context or requestContext. I would like to use it for logging, but I need the context (in our case, it holds a request ID which we'd like to see in our monitoring).

We work around this by using willSendResponse instead. This works, however in TypeScript this requires casting of GraphQLFormattedError to GraphQLError to get all the details we'd like to log. This could lead to bugs if apollo-server ever decides to strip the additional properties of GraphQLError when converting to GraphQLFormattedError.

@martijnwalraven
Copy link
Contributor

didEncounterErrors should have access to the current context under requestContext.context: #2719. Feel free to re-open this issue if that isn't working for you.

@cuchi
Copy link

cuchi commented Aug 14, 2019

I think @morris meant to use the Context via the graphql-extensions API, which is something I also need, but it is not supported yet.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants