Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When transforming a delegating schema (i.e. utilizing the transformSchema method within transforms passed to wrapSchema), one technique for result transformation is to defer the work until field resolution time, i.e. by wrapping the resolve method for the appropriate field within the delegating schema.
This approach saves a round of result tree traversal., but, unfortunately, causes several issues:
= return type inconsistencies that affect using these fields for stitching (see: #1725, yaacovCR#35)
= type merging issues when fields are wrapped only in some subschemas
WrapType, WrapFields, HoistField, ExtendSchema transformers have been converted to utilize their transformResult methods to visit the result.
This PR embraces that result visiting as an independent step when required and introduces some generic utility functions to make that easier.
To do, in separate future PRs:
= use result visiting to implement leaf value conversion #1634
= use result visiting to convert errors from subschemas to full paths, a la #1650 to solve #1047. This set of changes is now a breaking change because getErrors is exported, and likely should be deferred until the next major release, which probably (?) should coincide with the next major release of upstream graphql-js.