Skip to content

Spec edits for incremental delivery, Validation#1223

Open
robrichard wants to merge 2 commits intoincremental-integrationfrom
incremental-integration-validation
Open

Spec edits for incremental delivery, Validation#1223
robrichard wants to merge 2 commits intoincremental-integrationfrom
incremental-integration-validation

Conversation

@robrichard
Copy link
Copy Markdown
Contributor

@robrichard robrichard commented Apr 9, 2026

Extracted from the full PR (#1110) and targeting an integration branch to aid in review.

Helpful reference material:

Comment thread spec/Section 5 -- Validation.md Outdated
Co-authored-by: Yaacov Rydzinski  <yaacovCR@gmail.com>
Comment on lines +1711 to +1719
** Formal Specification **

- For every {directive} in a document.
- Let {directiveName} be the name of {directive}.
- Let {mutationType} be the root Mutation type in {schema}.
- Let {subscriptionType} be the root Subscription type in {schema}.
- If {directiveName} is "defer" or "stream":
- The parent type of {directive} must not be {mutationType} or
{subscriptionType}.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's split this up into a @stream and @defer rule:

Suggested change
** Formal Specification **
- For every {directive} in a document.
- Let {directiveName} be the name of {directive}.
- Let {mutationType} be the root Mutation type in {schema}.
- Let {subscriptionType} be the root Subscription type in {schema}.
- If {directiveName} is "defer" or "stream":
- The parent type of {directive} must not be {mutationType} or
{subscriptionType}.
**Formal Specification**
- For each `@stream` {directive} in the document:
- Let {field} be the field to which the directive is applied.
- The parent type of {field} must not be the {`mutation`} _root
operation type_ or the {`subscription`} _root operation type_.

For defer it's on fragments so it's a little different. I'm not a big fan of this suggested edit, it's inspired by https://spec.graphql.org/draft/#sec-Fragment-Spread-Type-Existence but I feel like maybe we should branch on inline fragment vs named fragment spread.

- For each `@defer` {directive} in the document:
  - Let {fragmentType} be the target type of the fragment spread to which {directive} is applied.
  - {fragmentType} must not be the {`mutation`} _root
    operation type_ or the {`subscription`} _root operation type_.

Comment on lines +1723 to +1724
The defer and stream directives are not allowed to be used on root fields of the
mutation or subscription type.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
The defer and stream directives are not allowed to be used on root fields of the
mutation or subscription type.
The `@defer` and `@stream` directives are not allowed to be used on root fields of the
mutation or subscription type.


### Defer And Stream Directives Are Used On Valid Operations

** Formal Specification **
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
** Formal Specification **
**Formal Specification**

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