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

Introduce @disableErrorPropagation #1145

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

twof
Copy link
Contributor

@twof twof commented Mar 9, 2025

No description provided.

Copy link

netlify bot commented Mar 9, 2025

Deploy Preview for graphql-spec-draft ready!

Name Link
🔨 Latest commit a54c25a
🔍 Latest deploy log https://app.netlify.com/sites/graphql-spec-draft/deploys/67cce720665d180008ed8b34
😎 Deploy Preview https://deploy-preview-1145--graphql-spec-draft.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -386,6 +386,8 @@ either resolving to {null} if allowed or further propagated to a parent field.
If this occurs, any sibling fields which have not yet executed or have not yet
yielded a value may be cancelled to avoid unnecessary work.

This default error propagation behavior can be modified by using the `@disableErrorPropagation` directive on an operation. If this directive is present, field errors in non-null fields will not propagate to their parent fields. Instead, the field that experienced the error will return `null` (even if it's a non-null field) and the error will be added to the response's `errors` list, but parent fields will continue to be resolved normally. This allows clients to receive partial data with localized errors rather than having errors propagate and potentially nullify large portions of the response.
Copy link
Contributor

Choose a reason for hiding this comment

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

We might want to modify the existing text instead of adding a new paragraph. Read in isolation, the paragraph above become misleading.

Maybe just:

If during {ExecuteSelectionSet()} a field with a non-null {fieldType} raises a
_field error_ **and the operation does not define `@disableErrorPropagation`** 
then that error must propagate to this entire selection set, ...

@benjie
Copy link
Member

benjie commented Mar 10, 2025

See also discussion in #1050

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.

3 participants