Skip to content

Batch deferred fields by defer path - #1020

Draft
robrichard wants to merge 6 commits into
graphql:benjie/incremental2from
robrichard:robrichard/benjie/incremental2
Draft

Batch deferred fields by defer path#1020
robrichard wants to merge 6 commits into
graphql:benjie/incremental2from
robrichard:robrichard/benjie/incremental2

Conversation

@robrichard

@robrichard robrichard commented Mar 17, 2023

Copy link
Copy Markdown
Contributor
  • Updates the path on the pending object to point to defer location. Only one pending payload will be sent per path.
    Clients can use this to determine if a defer was inlined or not.
  • Only fields that are under the same defer path must be batched together. Slow fields can be delivered separately by aliasing the parent object (or potentially fragment aliases in the future)
  • All fields are only executed and delivered once

This PR also includes changes from #999

Admittedly, I have not spent much time thinking about @stream while writing this.

Rather than merging subSelectionSets of a field set using MergeSelectionSets and then calling CollectFields, introducing CollectSubfields allows the field set's groupedSubfieldSet to be calculated directly.

This may be helpful if the specification were ever to be altered such that additional state beyond the current selection set were to be required to calculate the response, i.e. if it were to be required to know the originating selectionSet of a given field within the fieldSet for determining when to communicate a reference signal.

See graphql#998 (comment)

# Conflicts:
#	spec/Section 6 -- Execution.md
@robrichard
robrichard force-pushed the robrichard/benjie/incremental2 branch from 1a1c71a to 9029304 Compare March 17, 2023 15:42
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.

1 participant