Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(graphql): do not use a resolver for the nested payload of a mutation or subscription #4289

Conversation

alanpoulain
Copy link
Member

Q A
Branch? 2.6
Tickets #3492 #4183
License MIT
Doc PR N/A

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).

@alanpoulain alanpoulain force-pushed the fix/graphql-no-resolver-nested-payload-mutation branch from d06397b to 94c7ddb Compare May 21, 2021 14:37
@alanpoulain alanpoulain merged commit 0617ba5 into api-platform:2.6 May 21, 2021
@alanpoulain alanpoulain linked an issue May 21, 2021 that may be closed by this pull request
@alanpoulain alanpoulain removed a link to an issue May 21, 2021
LoicBoursin pushed a commit to LoicBoursin/core that referenced this pull request Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant