apollographql / apollographql/apollo-server

willResolveField end hook not guaranteed to be called before end of execution

Open
#5,372 2 comments 0 reactions 1 assignee Claimed by @glasser View on GitHub
Dominant language
TypeScript
Stars
14k
Forks
2k
Avg merge
5h 30m
Merged PRs (30d)
1

Description

willResolveField end hooks (which at least are sync) are called from this special `whenResultIsFinished` on the result of a resolver. But that's in parallel with the processing done on that promise by GraphQL execution. So it's possible that it will be called later than the end of execution.

What this rolls up into is that `endTime` might end up missing from some nodes at the time the trace is either pre-encoded or converted to stats, so they will be missing an `endTime` on the trace and will not be counted for TypeStats if converted in the usage reporting plugin.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.