-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Replace ExecuteSelectionSet
with ExecuteGroupedFieldSet
#1039
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for graphql-spec-draft ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
4d62b8b
to
b342b58
Compare
(Rebased on |
b342b58
to
a52310e
Compare
(Rebased on |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@benjie we need to formally define "grouped field set" in Section 2 "Language". You might have done so in a prior PR that I missed. Here is the link to us defining "section sets" in section 2 https://spec.graphql.org/draft/#sec-Selection-Sets |
This is up-to-date and ready-to-go again. @yaacovCR or @JoviDeCroock; please can you confirm this latest text still aligns with GraphQL.js. @Keweiqu Since a "grouped field set" is only part of execution and doesn't have an expression in the language I've not defined it in chapter 2, but in chapter 6 instead. (Here's where the current spec first introduces the term: https://spec.graphql.org/draft/#sel-FANRFABAB5EnhJ ) |
Essentially this PR raises the concept of "grouped field sets" to be a top-level concept, and replaces the
ExecuteSelectionSet
method withExecuteGroupedFieldSet
(which essentially just drops the first line ofExecuteSelectionSet
, which was responsible for producing the grouped field set to be executed). It then refactors the rest of the spec to accommodate this change, reducing the repetition inExecuteQuery
,ExecuteMutation
andExecuteSubscriptionEvent
; and removingMergeSelectionSets
(which generated a "virtual" selection set to accomodate theExecuteSelectionSet
method), instead adding aCollectSubfields
algorithm which generates a grouped field set directly, ready for execution.I extracted this common refactoring from a number of my attempts to write spec changes for the
@defer
and@stream
directives - it turns out that this refactoring of the spec was always needed as a base for my changes. Similarly, @yaacovCR found similar in his attempts to address this same problem, and raised #999 extracted from his solution. This PR was introduced independently of #999 (other than using theCollectSubfields
algorithm name) however there is significant alignment, so @yaacovCR suggested that I raise it as an alternative PR.It may be easier to review this PR in "split" view rather than "unified" view.