@@ -369,9 +369,9 @@ continues until there are no more subfields to collect and execute.
369
369
operation. A root selection set always selects from a _ root operation type_ .
370
370
371
371
To execute the root selection set, the initial value being evaluated and the
372
- root type must be known, as well as whether each field must be executed
373
- serially , or normally by executing all fields in parallel (see
374
- [ Normal and Serial Execution] ( #sec-Normal-and-Serial-Execution ) .
372
+ root type must be known, as well as whether the fields must be executed in a
373
+ series , or normally by executing all fields in parallel (see
374
+ [ Normal and Serial Execution] ( #sec-Normal-and-Serial-Execution ) ) .
375
375
376
376
Executing the root selection set works similarly for queries (parallel),
377
377
mutations (serial), and subscriptions (where it is executed for each event in
@@ -396,10 +396,9 @@ executionMode):
396
396
### Field Collection
397
397
398
398
Before execution, each _ selection set_ is converted to a _ collected fields map_
399
- by calling {CollectFields()} by collecting all fields with the same response
400
- name, including those in referenced fragments, into an individual _ field set_ .
401
- This ensures that multiple references to fields with the same response name will
402
- only be executed once.
399
+ by collecting all fields with the same response name, including those in
400
+ referenced fragments, into an individual _ field set_ . This ensures that multiple
401
+ references to fields with the same response name will only be executed once.
403
402
404
403
:: A _ collected fields map_ is an ordered map where each entry is a _ response
405
404
name_ and its associated _ field set_ . A _ collected fields map_ may be produced
@@ -436,8 +435,8 @@ fragment ExampleFragment on Query {
436
435
}
437
436
```
438
437
439
- The depth-first-search order of the _ field set_ produced by {CollectFields()} is
440
- maintained through execution, ensuring that fields appear in the executed
438
+ The depth-first-search order of each _ field set_ produced by {CollectFields()}
439
+ is maintained through execution, ensuring that fields appear in the executed
441
440
response in a stable and predictable order.
442
441
443
442
CollectFields(objectType, selectionSet, variableValues, visitedFragments):
@@ -475,11 +474,11 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
475
474
- If {DoesFragmentTypeApply(objectType, fragmentType)} is {false}, continue
476
475
with the next {selection} in {selectionSet}.
477
476
- Let {fragmentSelectionSet} be the top-level selection set of {fragment}.
478
- - Let {fragmentCollectedFieldMap } be the result of calling
477
+ - Let {fragmentCollectedFieldsMap } be the result of calling
479
478
{CollectFields(objectType, fragmentSelectionSet, variableValues,
480
479
visitedFragments)}.
481
480
- For each {responseName} and {fragmentFields} in
482
- {fragmentCollectedFieldMap }:
481
+ {fragmentCollectedFieldsMap }:
483
482
- Let {fieldsForResponseName} be the _ field set_ value in
484
483
{collectedFieldsMap} for the key {responseName}; otherwise create the
485
484
entry with an empty ordered set.
@@ -490,11 +489,11 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
490
489
fragmentType)} is {false}, continue with the next {selection} in
491
490
{selectionSet}.
492
491
- Let {fragmentSelectionSet} be the top-level selection set of {selection}.
493
- - Let {fragmentCollectedFieldMap } be the result of calling
492
+ - Let {fragmentCollectedFieldsMap } be the result of calling
494
493
{CollectFields(objectType, fragmentSelectionSet, variableValues,
495
494
visitedFragments)}.
496
495
- For each {responseName} and {fragmentFields} in
497
- {fragmentCollectedFieldMap }:
496
+ {fragmentCollectedFieldsMap }:
498
497
- Let {fieldsForResponseName} be the _ field set_ value in
499
498
{collectedFieldsMap} for the key {responseName}; otherwise create the
500
499
entry with an empty ordered set.
@@ -518,8 +517,8 @@ directives may be applied in either order since they apply commutatively.
518
517
519
518
** Merging Selection Sets**
520
519
521
- In order to execute the sub-selections of a object typed field, all _ selection
522
- sets_ of each field with the same response name of the parent _ field set_ are
520
+ In order to execute the sub-selections of an object typed field, all _ selection
521
+ sets_ of each field with the same response name in the parent _ field set_ are
523
522
merged together into a single _ collected fields map_ representing the subfields
524
523
to be executed next.
525
524
@@ -554,9 +553,9 @@ CollectSubfields(objectType, fields, variableValues):
554
553
- For each {field} in {fields}:
555
554
- Let {fieldSelectionSet} be the selection set of {field}.
556
555
- If {fieldSelectionSet} is null or empty, continue to the next field.
557
- - Let {fieldCollectedFieldMap } be the result of {CollectFields(objectType,
556
+ - Let {fieldCollectedFieldsMap } be the result of {CollectFields(objectType,
558
557
fieldSelectionSet, variableValues)}.
559
- - For each {responseName} and {subfields} in {fieldCollectedFieldMap }:
558
+ - For each {responseName} and {subfields} in {fieldCollectedFieldsMap }:
560
559
- Let {fieldsForResponseName} be the _ field set_ value in
561
560
{collectedFieldsMap} for the key {responseName}; otherwise create the
562
561
entry with an empty ordered set.
0 commit comments