Skip to content

Fixes for incremenal delivery integration branch#1232

Merged
robrichard merged 1 commit into
incremental-integrationfrom
robrichard/fixes
Jun 15, 2026
Merged

Fixes for incremenal delivery integration branch#1232
robrichard merged 1 commit into
incremental-integrationfrom
robrichard/fixes

Conversation

@robrichard

Copy link
Copy Markdown
Contributor

In a previous discussion we had decided to validation agains any overlapping stream fields. This has already been implemented in graphql-js for some time
See graphql/defer-stream-wg#100 and graphql/graphql-js#4342

Additionally there were two instances of completed result that was not missed and not renamed to incremental
completion notice

@robrichard robrichard requested review from benjie and yaacovCR June 15, 2026 13:55
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 15, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: robrichard / name: Rob Richard (6cfe6b0)

Comment on lines -603 to -606
- If both {fieldA} and {fieldB} have a directive named `stream`.
- Let {streamA} be the directive named `stream` on {fieldA}.
- Let {streamB} be the directive named `stream` on {fieldB}.
- If {streamA} and {streamB} have identical sets of arguments, return {true}.

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.

Hmmm... "distinct members" may be doing a lot here. For example:

frag A on Foo {
  ...B
  ...B
}
frag B on Foo {
  blah @stream
}

might merge since B.blah is the same field twice, assuming that's what we mean by "distinct members", but

frag A on Foo {
  ...B
  ...C
}
frag B on Foo {
  blah @stream
}
frag C on Foo {
  blah @stream
}

would not, because B.blah != C.blah even though it seems that they should have the same result as in the previous example.

This is probably okay for @stream because it shouldn't really be fragment-merged in the same way regular fields would be (we want @stream to be used reasonably scarcely?)... but it warrants acknowledgement. It's a bit of a break from the norm for GraphQL.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes this is the behavior we want. See the discussion here: graphql/defer-stream-wg#100

It becomes an issue when the stream, even with the same arguments has different selection sets. One fragment can influence the performance characteristics of the stream on another fragment, which is why we decided to prohibit this.

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.

Hmmm... but what about:

frag A on Foo {
  ...B
  ...C
}
frag B on Foo {
  ...D @include(if: $var1)
}
frag C on Foo {
  ...D @defer(if: $var2)
}
frag D on Foo {
  blah @stream
}

Here, is A>B>D.foo seen as the same as A>C>D.foo? Are they distinct members?
... does it matter? 🤔 I suppose not...

@robrichard robrichard merged commit b57790d into incremental-integration Jun 15, 2026
5 checks passed
@robrichard robrichard deleted the robrichard/fixes branch June 15, 2026 14:24
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