Skip to content

Spec edits for incremental delivery, Execution: CollectFields#1234

Open
robrichard wants to merge 1 commit into
incremental-integrationfrom
robrichard/incremental-integration-collectfields
Open

Spec edits for incremental delivery, Execution: CollectFields#1234
robrichard wants to merge 1 commit into
incremental-integrationfrom
robrichard/incremental-integration-collectfields

Conversation

@robrichard

Copy link
Copy Markdown
Contributor

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

Helpful reference material:

@robrichard
robrichard force-pushed the robrichard/incremental-integration-collectfields branch 3 times, most recently from 776bcf4 to 04ec588 Compare July 15, 2026 19:29
Co-authored-by: Yaacov Rydzinski <yaacovCR@gmail.com>
@robrichard
robrichard force-pushed the robrichard/incremental-integration-collectfields branch from 04ec588 to 1df6a26 Compare July 16, 2026 17:41
Comment on lines +447 to +453
:: A _defer usage_ is an unordered map representing the usage of a `@defer`
directive within a given operation. _Defer usage_ are "abstract" in that they
include information about the `@defer` directive from the AST of the GraphQL
document. A single _defer usage_ may be used to create many "concrete" Delivery
Groups when a `@defer` is included within a list type.

A _defer usage_ contains the following information:

@benjie benjie Jul 16, 2026

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
:: A _defer usage_ is an unordered map representing the usage of a `@defer`
directive within a given operation. _Defer usage_ are "abstract" in that they
include information about the `@defer` directive from the AST of the GraphQL
document. A single _defer usage_ may be used to create many "concrete" Delivery
Groups when a `@defer` is included within a list type.
A _defer usage_ contains the following information:
:: A _defer usage_ represents the usage of a `@defer` directive during field
collection; it contains the following information:

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.

Update algorithm references to defer usage to require a map datastructure

- Let {fragmentDeferUsage} be an unordered map containing {label} and
        {parentDeferUsage}.
+ Let {fragmentDeferUsage} be {label} and {parentDeferUsage}.

Comment thread spec/Section 6 -- Execution.md Outdated
The {parentDeferUsage} entry is used to build distinct Execution Groups as
discussed within the Execution Plan Generation section below.

:: A _field detail_ is an unordered maps containing the following entries:

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.

Needs a more descriptive definition

Comment on lines +466 to +467
- {deferUsage}: the _defer usage_ enclosing the selection, if any, otherwise
{undefined}.

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
- {deferUsage}: the _defer usage_ enclosing the selection, if any, otherwise
{undefined}.
- {deferUsage}: the _defer usage_ enclosing the selection, if any.

Comment on lines +472 to +477
The {CollectFields()} algorithm returns:

- {collectedFieldsMap}: the _collected fields map_ for the fields in the
selection set.
- {newDeferUsages}: a list of new _defer usage_ encountered during this field
collection.

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 {CollectFields()} algorithm returns:
- {collectedFieldsMap}: the _collected fields map_ for the fields in the
selection set.
- {newDeferUsages}: a list of new _defer usage_ encountered during this field
collection.

Comment on lines +442 to +443
CollectFields(objectType, selectionSet, variableValues, deferUsage,
visitedFragments):

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.

move to directly above the algorithm definition


Note: When completing a List field, the {CollectFields} algorithm is invoked
with the same arguments for each element of the list. GraphQL Services may
choose to memoize their implementations of {CollectFields}.

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.

Make this a stronger recommendation and explain why

{false}:
- Let {deferDirective} be that directive.
- If this execution is for a subscription operation, raise an _execution
error_.

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
error_.
error_.
- Otherwise let {deferDirective} be {null}.

Comment on lines +514 to +515
- If {deferDirective} is not defined:
- Add {fragmentSpreadName} to {visitedFragments}.

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.

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.

2 participants