Skip to content

Commit cc17846

Browse files
committed
editorial
1 parent de56b68 commit cc17846

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

spec/Section 6 -- Execution.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,10 @@ executionMode):
388388
### Field Collection
389389

390390
Before execution, each _selection set_ is converted to a _collected fields map_
391-
by calling {CollectFields()}. This ensures all fields with the same response
392-
name, including those in referenced fragments, are executed at the same time.
391+
by calling {CollectFields()} by collecting all fields with the same response
392+
name, including those in referenced fragments, into an individual _field set_.
393+
This ensures that multiple references to fields with the same response name will
394+
only be executed once.
393395

394396
:: A _collected fields map_ is an ordered map where each entry is a _response
395397
name_ and its associated _field set_. A _collected fields map_ may be produced
@@ -558,16 +560,12 @@ name_.
558560

559561
### Executing Collected Fields
560562

561-
The {CollectFields()} and {CollectSubfields()} algorithms transitively collect
562-
the field selections from a _selection set_ or the associated selection sets of
563-
a _field set_ respectively, and split them into sets by their _response name_ to
564-
produce a _collected fields map_.
565-
566563
To execute a _collected fields map_, the object type being evaluated and the
567564
runtime value need to be known, as well as the runtime values for any variables.
568565

569-
Each entry in the collected fields map represents a _response name_ which
570-
produces an entry into a result map.
566+
Execution will recursively resolve and complete the value of every entry in the
567+
collected fields map, producing an entry in the result map with the same
568+
_response name_ key.
571569

572570
ExecuteCollectedFields(collectedFieldsMap, objectType, objectValue,
573571
variableValues):
@@ -608,7 +606,7 @@ about this behavior.
608606

609607
### Normal and Serial Execution
610608

611-
Normally the executor can execute the entries in a collected fields map in
609+
Normally the executor can execute the entries in a _collected fields map_ in
612610
whatever order it chooses (normally in parallel). Because the resolution of
613611
fields other than top-level mutation fields must always be side effect-free and
614612
idempotent, the execution order must not affect the result, and hence the
@@ -708,11 +706,11 @@ A correct executor must generate the following result for that _selection set_:
708706

709707
## Executing Fields
710708

711-
Each field from the _collected fields map_ that is defined on the selected
712-
objectType will result in an entry in the result map. Field execution first
713-
coerces any provided argument values, then resolves a value for the field, and
714-
finally completes that value either by recursively executing another selection
715-
set or coercing a scalar value.
709+
Each entry in a result map is the result of executing a field on an object type
710+
selected by the name of that field in a _collected fields map_. Field execution
711+
first coerces any provided argument values, then resolves a value for the field,
712+
and finally completes that value either by recursively executing another
713+
selection set or coercing a scalar value.
716714

717715
ExecuteField(objectType, objectValue, fieldType, fields, variableValues):
718716

@@ -812,7 +810,8 @@ returned by {resolver} may itself be retrieved asynchronously.
812810

813811
After resolving the value for a field, it is completed by ensuring it adheres to
814812
the expected return type. If the return type is another Object type, then the
815-
field execution process continues recursively.
813+
field execution process continues recursively by collecting and executing
814+
subfields.
816815

817816
CompleteValue(fieldType, fields, result, variableValues):
818817

0 commit comments

Comments
 (0)