fix(graphql): do not use a resolver for the nested payload of a mutation or subscription #4289
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.
Fixes a regression introduced in d6f2603#diff-d7bf2d1671fc1d774236691a30000b7d2c1a9296094faf093c98fd549f727bd5R299-R300.
The resolver for the mutation (and the subscription) was set for nested payload properties and was wrongly called when resolving the root mutation.
This PR fixes the issue by only setting the mutation resolver for the root payload and uses the item / collection resolver for the nested payload properties.
Notice that this issue only appears when a specific normalization context is used for the mutation (different of the query one). Else the item type is used instead of the nested payload type (for client caching).