@@ -376,9 +376,9 @@ continues until there are no more subfields to collect and execute.
376
376
operation. A root selection set always selects from a _ root operation type_ .
377
377
378
378
To execute the root selection set, the initial value being evaluated and the
379
- root type must be known, as well as whether each field must be executed
380
- serially , or normally by executing all fields in parallel (see
381
- [ Normal and Serial Execution] ( #sec-Normal-and-Serial-Execution ) .
379
+ root type must be known, as well as whether the fields must be executed in a
380
+ series , or normally by executing all fields in parallel (see
381
+ [ Normal and Serial Execution] ( #sec-Normal-and-Serial-Execution ) ) .
382
382
383
383
Executing the root selection set works similarly for queries (parallel),
384
384
mutations (serial), and subscriptions (where it is executed for each event in
@@ -403,10 +403,9 @@ executionMode):
403
403
### Field Collection
404
404
405
405
Before execution, each _ selection set_ is converted to a _ collected fields map_
406
- by calling {CollectFields()} by collecting all fields with the same response
407
- name, including those in referenced fragments, into an individual _ field set_ .
408
- This ensures that multiple references to fields with the same response name will
409
- only be executed once.
406
+ by collecting all fields with the same response name, including those in
407
+ referenced fragments, into an individual _ field set_ . This ensures that multiple
408
+ references to fields with the same response name will only be executed once.
410
409
411
410
:: A _ collected fields map_ is an ordered map where each entry is a _ response
412
411
name_ and its associated _ field set_ . A _ collected fields map_ may be produced
@@ -443,8 +442,8 @@ fragment ExampleFragment on Query {
443
442
}
444
443
```
445
444
446
- The depth-first-search order of the _ field set_ produced by {CollectFields()} is
447
- maintained through execution, ensuring that fields appear in the executed
445
+ The depth-first-search order of each _ field set_ produced by {CollectFields()}
446
+ is maintained through execution, ensuring that fields appear in the executed
448
447
response in a stable and predictable order.
449
448
450
449
CollectFields(objectType, selectionSet, variableValues, visitedFragments,
@@ -494,11 +493,11 @@ fragmentVariables):
494
493
- Let {newFragmentVariables} be an unordered map containing {signatures} and
495
494
{values}.
496
495
- Let {fragmentSelectionSet} be the top-level selection set of {fragment}.
497
- - Let {fragmentCollectedFieldMap } be the result of calling
496
+ - Let {fragmentCollectedFieldsMap } be the result of calling
498
497
{CollectFields(objectType, fragmentSelectionSet, variableValues,
499
498
visitedFragments, newFragmentVariables)}.
500
499
- For each {responseName} and {fragmentFields} in
501
- {fragmentCollectedFieldMap }:
500
+ {fragmentCollectedFieldsMap }:
502
501
- Let {fieldsForResponseName} be the _ field set_ value in
503
502
{collectedFieldsMap} for the key {responseName}; otherwise create the
504
503
entry with an empty ordered set.
@@ -509,11 +508,11 @@ fragmentVariables):
509
508
fragmentType)} is {false}, continue with the next {selection} in
510
509
{selectionSet}.
511
510
- Let {fragmentSelectionSet} be the top-level selection set of {selection}.
512
- - Let {fragmentCollectedFieldMap } be the result of calling
511
+ - Let {fragmentCollectedFieldsMap } be the result of calling
513
512
{CollectFields(objectType, fragmentSelectionSet, variableValues,
514
513
visitedFragments, fragmentVariables)}.
515
514
- For each {responseName} and {fragmentFields} in
516
- {fragmentCollectedFieldMap }:
515
+ {fragmentCollectedFieldsMap }:
517
516
- Let {fieldsForResponseName} be the _ field set_ value in
518
517
{collectedFieldsMap} for the key {responseName}; otherwise create the
519
518
entry with an empty ordered set.
@@ -537,8 +536,8 @@ directives may be applied in either order since they apply commutatively.
537
536
538
537
** Merging Selection Sets**
539
538
540
- In order to execute the sub-selections of a object typed field, all _ selection
541
- sets_ of each field with the same response name of the parent _ field set_ are
539
+ In order to execute the sub-selections of an object typed field, all _ selection
540
+ sets_ of each field with the same response name in the parent _ field set_ are
542
541
merged together into a single _ collected fields map_ representing the subfields
543
542
to be executed next.
544
543
@@ -573,9 +572,9 @@ CollectSubfields(objectType, fields, variableValues):
573
572
- For each {field} in {fields}:
574
573
- Let {fieldSelectionSet} be the selection set of {field}.
575
574
- If {fieldSelectionSet} is null or empty, continue to the next field.
576
- - Let {fieldCollectedFieldMap } be the result of {CollectFields(objectType,
575
+ - Let {fieldCollectedFieldsMap } be the result of {CollectFields(objectType,
577
576
fieldSelectionSet, variableValues)}.
578
- - For each {responseName} and {subfieldInfos} in {fieldCollectedFieldMap }:
577
+ - For each {responseName} and {subfieldInfos} in {fieldCollectedFieldsMap }:
579
578
- Let {fieldsForResponseName} be the _ field set_ value in
580
579
{collectedFieldsMap} for the key {responseName}; otherwise create the
581
580
entry with an empty ordered set.
0 commit comments