Callback returned from executionDidStart is not triggered when error occurs #3705
Labels
🍐 error-handling
Pertaining to error handling (or lack thereof), not just for just general errors/bugs.
🔌 plugins
Relates to the request pipeline plugin API
I'm trying to implement a plugin that should receive an error when query execution fails. I have the following plugin code:
When I throw an error in a resolver
didEncounterErrors
gets called but callback returned fromexecutionDidStart
does not.After a quick debug I found that error is not re-thrown when
result
returned from execution has errors property: https://github.com/apollographql/apollo-server/blob/master/packages/apollo-server-core/src/requestPipeline.ts#L370My assumption is that instead of calling
didEncounterErrors
it should probably callemitErrorAndThrow
.The text was updated successfully, but these errors were encountered: