-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Change "grouped field set" to be a map of ordered sets #1161
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
Conversation
c7532d1
to
6e76340
Compare
6e76340
to
3c6dfb3
Compare
I believe the current specification has For what it's worth, I support #1045 as well as this change. :) |
c776fa7
to
97d43ba
Compare
* Extract common logic from ExecuteQuery, ExecuteMutation and ExecuteSubscriptionEvent * Change ExecuteSelectionSet to ExecuteGroupedFieldSet * Correct reference to MergeSelectionSets * move Field Collection section earlier (#1111) * Define 'grouped field set' * that -> which * More similar to prior wording * Remove reason from definition * subGroupedFieldSet -> fieldGroupedFieldSet * Add note for clarity * move field collections into one section, section reworking, minor word tweaking, enum * Apply suggestions from code review * Rename 'ExecuteGroupedFieldSet' to 'ExecuteCollectedFields' * Lee editorial + manual merge #1161 * also rename grouped field set -> collected fields map * include changes after merging master * fixup map iterations * editorial --------- Co-authored-by: Yaacov Rydzinski <[email protected]> Co-authored-by: Lee Byron <[email protected]>
This was merged into #1039 and since merged into the spec. |
Extension to #1039
Currently:
I propose that we defined "field set" to be an ordered set (rather than list) of fields that all share the same response name. This makes a lot of the spec clearer, e.g. it's much clearer why
ExecuteField()
should receive a "field set" (since they all share the same response name) rather than simply receiving "fields".Essentially I propose:
This also makes the term "grouped field set" a lot clearer.
It also increases efficiency; consider this query:
Prior to this change:
ExecuteRootSelectionSet
usesCollectFields
to produce this grouped field set:CompleteValue
callsCollectSubfields
to produce this grouped field set (assumingCat
):visitedFragments
doesn't prevent this because it doesn't work across sibling selections, only nested selectionsIf we were to have deeper nesting, this duplication would get much worse. Memory wise, this isn't a big deal, but looping-wise we're looping a lot more than we need to.
By explicitly making this a set, we remove this duplication. The phrase "if not already present" makes it clear that the first field selection "wins", which is important for ordering.