Skip to content

Spec edits for incremental delivery, Response Section and Examples Appendix#1203

Open
robrichard wants to merge 14 commits intoincremental-integrationfrom
incremental-integration-response
Open

Spec edits for incremental delivery, Response Section and Examples Appendix#1203
robrichard wants to merge 14 commits intoincremental-integrationfrom
incremental-integration-response

Conversation

@robrichard
Copy link
Copy Markdown
Contributor

@robrichard robrichard commented Oct 31, 2025

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

The response section is especially important, as it defines all of the terms which will be used in the execution algorithm

Helpful reference material:

@robrichard robrichard force-pushed the incremental-integration-response branch from 2bb67fc to 30bc97f Compare November 6, 2025 20:03
@HenriVesala
Copy link
Copy Markdown

HenriVesala commented Dec 3, 2025

is this stuck in limbo? Or is there something that I could help on?

Copy link
Copy Markdown
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

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

I don't know if it's just me, but I feel like the examples could use more narrative and explanation that this is just one way the query could turn out. Here's how I'd change the beginning of the first example:

@robrichard robrichard requested a review from benjie January 15, 2026 17:27
@robrichard robrichard force-pushed the incremental-integration-response branch 2 times, most recently from c024bf1 to 9e42f6c Compare February 19, 2026 20:03
@robrichard robrichard force-pushed the incremental-integration branch from 003ed2a to 87a05e3 Compare March 19, 2026 16:52
@robrichard robrichard force-pushed the incremental-integration-response branch from 6b7397a to b9d8e8a Compare March 19, 2026 16:53
Depending on the behavior of the backend and the time at which the deferred and
streamed resources resolve, the stream may produce results in different orders.
In this example, our first _incremental stream update result_ contains the
deferred data and the first streamed list item. There is one _completed result_,
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.

Maybe change "completed result" to "incremental completion result" to tie it in with the "incremental" naming? (Also to be more specific.)

Suggested change
deferred data and the first streamed list item. There is one _completed result_,
deferred data and the first streamed list item. There is one _incremental completion result_,

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.

Updated now to incremental completion notice

Comment on lines +177 to +180
{
"id": "0",
"data": { "homeWorld": { "name": "Tatooine" } }
},
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.

I feel like the weirdness of this needs more calling out - name belongs to both id:0 and id:1, so we're kind of using id:0 as a shortcut (but id:1 would also work). We should make it clear to a client that it can't form HomeWorldFragment from solely the root data plus the id:0 stuff and NameAndHomeWorldFragment from solely the root data and the id:1 stuff - they must merge the trees before extracting the data.

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.

Comment on lines +92 to +101
The _initial incremental stream result_ must contain an entry with key {"data"},
and may contain entries with keys {"errors"} and {"extensions"}. The value of
these entries are defined in the same way as an _execution result_ as described
in the "Data", "Errors", and "Extensions" sections below.

The _initial incremental stream result_ must contain an entry with the key
{"hasNext"}. The value of this entry must be {true} if there are any
_incremental stream update results_ in the _incremental stream_. The value of
this entry must be {false} if the initial incremental stream result is the last
response of the incremental stream.
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.

Splitting this across two paragraphs is a little weird, I feel like the list of keys up front should be exhaustive.

Suggested change
The _initial incremental stream result_ must contain an entry with key {"data"},
and may contain entries with keys {"errors"} and {"extensions"}. The value of
these entries are defined in the same way as an _execution result_ as described
in the "Data", "Errors", and "Extensions" sections below.
The _initial incremental stream result_ must contain an entry with the key
{"hasNext"}. The value of this entry must be {true} if there are any
_incremental stream update results_ in the _incremental stream_. The value of
this entry must be {false} if the initial incremental stream result is the last
response of the incremental stream.
The _initial incremental stream result_ must contain an entries with keys {"data"} and {"hasNext"}, and may contain entries with keys
{"errors"}, {"pending"}, {"incremental"}, {"completed"}, and {"extensions"}.
The value of {"data"}, {"errors"} and {"extensions"} are defined in the
same way as an _execution result_ as described in the "Data", "Errors", and
"Extensions" sections below.
The value of the {"hasNext"} entry must be {false}
if the initial incremental stream result is the last response of the incremental
stream. Otherwise, {"hasNext"} must be {true}.

I'd like to see a non-normative note below this explaining that {"hasNext"} is required only for it to be an initial incremental stream result, and that omitting it is valid if it's the only result, just that it means it's an execution result instead (i.e. there's no "incremental" at all). In this case, the GraphQL response would not return a stream.

This is a terrible version of that note since I'm writing this already over-time on our call...

Note: Omitting {"hasNext"} would make the response a regular execution result, which is valid only when returned directly and not as part of a stream.

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.

This suggested edit changes pending from required to optional on the initial incremental stream result, I don't think we have a case for an incremental stream without a pending? I will keep it as required when I incorporate this change.

Do you still think we need a note about omitting hasNext? it's a bit more complicated as you also need to omit pending?

I will however add a note explaining the reasoning for allowing hasNext: false in the initial incremental stream result

Comment on lines +108 to +111
The _initial incremental stream result_ may contain an entry with they key
{"incremental"}. The value of this entry must be a non-empty list of
_incremental result_. Each _incremental result_ must be a map as described in
the "Incremental Result" section below.
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.

I'd add a non-normative note detailing why this is allowed.

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.

Same for "completed"

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.

Comment on lines +103 to +106
The _initial incremental stream result_ must contain an entry with the key
{"pending"}. The value of this entry must be a non-empty list of _pending
result_. Each _pending result_ must be a map as described in the "Pending
Result" section below.
Copy link
Copy Markdown
Member

@benjie benjie Mar 19, 2026

Choose a reason for hiding this comment

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

If "hasNext" is true, pending must be present.
If "hasNext" is false, pending must not be present. < Not true, could be hasNext:false along with pending:[...],incremental:[...],completed:[...]

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.

Going to leave this as is since pending must be present in all cases for the initial incremental stream result

Comment on lines +140 to +144
The _incremental stream update result_ may contain entries with keys
{"pending"}, {"incremental"}, and/or {"completed"}. The value of these entries
are defined in the same way as an _initial incremental stream result_ as
described in the "Pending Result", "Incremental Result", and "Completed Result"
sections below.
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.

Should we add that {"hasNext": true} alone is invalid?

I propose that we do not do so. Not doing so allows {"hasNext: true} to be used as a keepalive.

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.

Agreed, do you think we should specifically mention this, outside of every other entry being defined as optional?

Comment on lines +566 to +568
clients, any of the maps described in the "Response" section (with the exception
of {"extensions"}) must not contain any entries other than those described
above. Clients must ignore any entries other than those described above.
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.

We could probably upstream this change.

Copy link
Copy Markdown
Contributor

@yaacovCR yaacovCR left a comment

Choose a reason for hiding this comment

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

This is amazing work, and others have given already and I’m sure we’ll continue to give wonderful feedback.

My two cents is that it may be beneficial to refer to the pending/completed and possibly even the incremental entries as notifications rather than results. The result is the deferred/streamed data at that path that has an id. It’s an abstract concept in terms of the response format, to be assembled, perhaps as needed, by the client.

The response can strictly speaking never send a pending result, in fact that’s in some sense an internal contradiction, or, at best, a shorthand for what we really mean, a notification or description of a result that is pending/completed. The incremental entries are actually results/updates, although calling them as such may confuse them with the overarching defer/stream result that they help complete.

I offer this comment just as a suggestion, I could live with this somewhat confusing shorthand if others feel that it is the best compromise in terms of clarity.

@robrichard robrichard force-pushed the incremental-integration-response branch from 122ea6a to 6a6f38b Compare March 21, 2026 21:44
@robrichard robrichard force-pushed the incremental-integration-response branch from 6a6f38b to ffacdf4 Compare March 21, 2026 21:45
@robrichard
Copy link
Copy Markdown
Contributor Author

@yaacovCR @benjie The following terms have now been updated:

Pending Result => Incremental Pending Notice
Completed Result => Incremental Completion Notice

@robrichard robrichard requested a review from benjie March 23, 2026 17:20
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.

6 participants