Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch deferred fields by defer path #1020

Draft
wants to merge 6 commits into
base: benjie/incremental2
Choose a base branch
from

Conversation

robrichard
Copy link
Contributor

@robrichard robrichard commented Mar 17, 2023

  • 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