-
Notifications
You must be signed in to change notification settings - Fork 2k
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
didEncounterErrors
is not triggered when an error occurs in context
creation.
#3223
Comments
This is a severe error if it happens, which is why we wrap it for you and throw a pre-defined error. If you have error-prone code in your |
Out of curiosity though, what would you propose happen in |
Specifically, Though, I thought I use the Wrapping |
didEncounterErrors
is not triggered when an error occurs in context
creation.
The naming is a bit confusing but To me, it sounds like a bug that |
Having the same problem, we throw an |
We also had this issue, we had a production incident with errors being created by from Neither the
That said, I get that The only way we were able to see a glimpse of the error, was in our user's response payloads in the chrome dev console Network tab:
(Using the apollo-server-express 2.16.1.) I'm fairly ambivalent about how this is handled, but even fwiw Apollo directly doing a hard-coded |
This is definitely unexpected behavior for me - glad I had this happen before I went to production as zero logging is not good when you think you have your bases covered with I wouldn't be surprised if half the people using apollo have something like this in their code (that ends up being a gotcha).
Maybe this could be added to the docs prominently if you want to not have this go to Or maybe rename to |
Want to offer a use case:
We do! In fact, it was inspired by the guidance in "API-wide authentication". Our GraphQL API serves only confidential data and privileged mutations, so denying all requests that lack valid authentication is appealing to us. |
@abernix has there been any progress on this? I've just encountered this problem for the same reason (error logging). I'm using apollo server express v3.6.2 |
Let's track this as part of the current AS4 work: #6140. |
(closing as duplicate of #6140) |
Bug
@abernix edits: The
didEncounterErrors
life-cycle hook is not invoked when errors occur within context creation. That shouldn't be the case!Original feature request
As of version 2.9.0, there is no lifecycle event to handle manually errors encountered in the context creation process.
Suggestion:
The text was updated successfully, but these errors were encountered: