Closed sergey-stoyan closed 3 months ago
Revert back afterFieldResolve hook invocation way: it is called now when the field is actually resolved.
Hmm, afaik the executor refers to resolving and completing the value separately, so shouldn't this be called afterFieldComplete
instead?
Hmm, afaik the executor refers to resolving and completing the value separately, so shouldn't this be called
afterFieldComplete
instead?
Yep, that's why we have 2 hooks: afterFieldComplete
and afterFieldResolve
. The first one is invoked after the field itself and all it's child fields (if field value is an object) are resolved, so that field resolution can be considered as completed
. And the second - when only field itself is resolved, and it's current implementation does not fully correspond to "afterResolve" concept, since the promise could be returned for async resolver. This PR changes that behavior to invoke afterResolve when the field value is actually resolved for both sync and async resolvers.
__typename
.printPathArray
: remove beginning.
and use+=
instead of map/join to speed up strings merging.