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

Respect errorPolicy for mutation and subscription results. #7003

Merged

Conversation

benjamn
Copy link
Member

@benjamn benjamn commented Sep 11, 2020

Using the default ErrorPolicy of "none" for queries means no data will be written to the cache when a GraphQL result has errors.

Queries can use errorPolicy: "ignore" and errorPolicy: "all" to ensure data is written to the cache in spite of GraphQL errors, but mutations and subscriptions were previously limited to the default policy, "none".

This commit makes mutations and subscriptions respect the non-default "ignore" and "all" ErrorPolicy values, just as queries do, hopefully addressing #6965.

Since these changes did not cause any tests to fail, clearly we need more and better tests of non-default ErrorPolicy usage by mutations and subscriptions.

Copy link
Member

@hwillson hwillson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me @benjamn - thanks!

benjamn added a commit that referenced this pull request Sep 11, 2020
Using the default ErrorPolicy of "none" for queries means no data will be
written to the cache when a GraphQL result has errors.

Queries can use errorPolicy:"ignore" and errorPolicy:"all" to ensure data
is written to the cache in spite of GraphQL errors, but mutations and
subscriptions were previously limited to the default policy, "none".

This commit makes mutations and subscriptions respect the non-default
"ignore" and "all" ErrorPolicy values, just as queries do, hopefully
addressing #6965.

Since these changes did not cause any tests to fail, clearly we need more
tests of non-default ErrorPolicy usage by mutations and subscriptions.
@benjamn benjamn force-pushed the make-mutations-and-subscriptions-respect-error-policy branch from 87a26b4 to acef8ca Compare September 11, 2020 18:44
@benjamn benjamn merged commit 62facae into release-3.2 Sep 11, 2020
@benjamn benjamn deleted the make-mutations-and-subscriptions-respect-error-policy branch September 11, 2020 19:10
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants