Skip to content

Commit 6e76340

Browse files
committed
Rename 'ExecuteGroupedFieldSet' to 'ExecuteCollectedFields'
1 parent 180a51c commit 6e76340

File tree

2 files changed

+29
-15
lines changed

2 files changed

+29
-15
lines changed

spec/Section 3 -- Type System.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ type Person {
757757
}
758758
```
759759

760-
Valid operations must supply a nested field set for any field that returns an
760+
Valid operations must supply a selection of fields for any field that returns an
761761
object, so this operation is not valid:
762762

763763
```graphql counter-example

spec/Section 6 -- Execution.md

+28-14
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ executionMode):
377377

378378
- Let {groupedFieldSet} be the result of {CollectFields(objectType,
379379
selectionSet, variableValues)}.
380-
- Let {data} be the result of running {ExecuteGroupedFieldSet(groupedFieldSet,
380+
- Let {data} be the result of running {ExecuteCollectedFields(groupedFieldSet,
381381
objectType, initialValue, variableValues)} _serially_ if {executionMode} is
382382
{"serial"}, otherwise _normally_ (allowing parallelization)).
383383
- Let {errors} be the list of all _execution error_ raised while executing the
@@ -386,17 +386,26 @@ executionMode):
386386

387387
### Field Collection
388388

389-
Before execution, the _selection set_ is converted to a _grouped field set_ by
390-
calling {CollectFields()}. This ensures all fields with the same response name,
391-
including those in referenced fragments, are executed at the same time.
389+
Before execution, the _root selection set_ is converted to a _grouped field set_
390+
by calling {CollectFields()}. This ensures all fields with the same response
391+
name, including those in referenced fragments, are executed at the same time.
392392

393-
:: A _grouped field set_ is a map where each entry is a _response name_ and a
394-
list of selected fields that share that _response name_ (the field alias if
395-
defined, otherwise the field's name).
393+
:: A _grouped field set_ is a map where each entry is a _response name_ and its
394+
associated _field set_. A _grouped field set_ may be produced from a selection
395+
set via {CollectFields()} or from the selection sets of a _field set_ via
396+
{CollectSubfields()}.
396397

397-
As an example, collecting the fields of this selection set would result in a
398-
grouped field set with two entries, `"a"` and `"b"`, with two instances of the
399-
field `a` and one of field `b`:
398+
:: A _field set_ is a list of selected fields that share the same _response
399+
name_ (the field alias if defined, otherwise the field's name).
400+
401+
Note: The order of field selections in a _field set_ is significant, hence the
402+
algorithms in this specification model it as a list. Any later duplicated field
403+
selections in a field set will not impact its interpretation, so using an
404+
ordered set would yield equivalent results.
405+
406+
As an example, collecting the fields of this query's selection set would result
407+
in a grouped field set with two entries, `"a"` and `"b"`, with two instances of
408+
the field `a` and one of field `b`:
400409

401410
```graphql example
402411
{
@@ -542,7 +551,12 @@ CollectSubfields(objectType, fields, variableValues):
542551
Note: All the {fields} passed to {CollectSubfields()} share the same _response
543552
name_.
544553

545-
### Executing a Grouped Field Set
554+
### Executing Collected Fields
555+
556+
The {CollectFields()} and {CollectSubfields()} algorithms collect together all
557+
of the field selections from a _selection set_ or the nested selection sets of a
558+
_field set_ respectively, and split them into groups by their _response name_ to
559+
produce a _grouped field set_.
546560

547561
To execute a _grouped field set_, the object value being evaluated and the
548562
object type need to be known, as well as whether it must be executed serially,
@@ -552,7 +566,7 @@ or may be executed in parallel (see
552566
Each entry in the grouped field set represents a _response name_ which produces
553567
an entry into a result map.
554568

555-
ExecuteGroupedFieldSet(groupedFieldSet, objectType, objectValue,
569+
ExecuteCollectedFields(groupedFieldSet, objectType, objectValue,
556570
variableValues):
557571

558572
- Initialize {resultMap} to an empty ordered map.
@@ -577,7 +591,7 @@ section.
577591
<!-- Legacy link, this section was previously titled "Errors and Non-Null Fields" -->
578592
</a>
579593

580-
If during {ExecuteGroupedFieldSet()} a _response position_ with a non-null type
594+
If during {ExecuteCollectedFields()} a _response position_ with a non-null type
581595
raises an _execution error_ then that error must propagate to the parent
582596
response position (the entire selection set in the case of a field, or the
583597
entire list in the case of a list position), either resolving to {null} if
@@ -820,7 +834,7 @@ CompleteValue(fieldType, fields, result, variableValues):
820834
- Let {objectType} be {ResolveAbstractType(fieldType, result)}.
821835
- Let {groupedFieldSet} be the result of calling {CollectSubfields(objectType,
822836
fields, variableValues)}.
823-
- Return the result of evaluating {ExecuteGroupedFieldSet(groupedFieldSet,
837+
- Return the result of evaluating {ExecuteCollectedFields(groupedFieldSet,
824838
objectType, result, variableValues)} _normally_ (allowing for
825839
parallelization).
826840

0 commit comments

Comments
 (0)