@@ -271,10 +271,10 @@ CreateSourceEventStream(subscription, schema, variableValues, initialValue):
271
271
- Let {groupedFieldSet} be the result of {CollectFields(subscriptionType,
272
272
selectionSet, variableValues)}.
273
273
- If {groupedFieldSet} does not have exactly one entry, raise a _ request error_ .
274
- - Let {fields } be the value of the first entry in {groupedFieldSet}.
275
- - Let {fieldName} be the name of the first entry in {fields }. Note: This value
274
+ - Let {fieldSet } be the value of the first entry in {groupedFieldSet}.
275
+ - Let {fieldName} be the name of the first entry in {fieldSet }. Note: This value
276
276
is unaffected if an alias is used.
277
- - Let {field} be the first entry in {fields }.
277
+ - Let {field} be the first entry in {fieldSet }.
278
278
- Let {argumentValues} be the result of {CoerceArgumentValues(subscriptionType,
279
279
field, variableValues)}.
280
280
- Let {sourceStream} be the result of running
@@ -430,7 +430,7 @@ response in a stable and predictable order.
430
430
CollectFields(objectType, selectionSet, variableValues, visitedFragments):
431
431
432
432
- If {visitedFragments} is not provided, initialize it to the empty set.
433
- - Initialize {groupedFields } to an empty ordered map of lists.
433
+ - Initialize {groupedFieldSet } to an empty ordered map of lists.
434
434
- For each {selection} in {selectionSet}:
435
435
- If {selection} provides the directive ` @skip ` , let {skipDirective} be that
436
436
directive.
@@ -445,9 +445,9 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
445
445
- If {selection} is a {Field}:
446
446
- Let {responseName} be the _ response name_ of {selection} (the alias if
447
447
defined, otherwise the field name).
448
- - Let {groupForResponseName } be the list in {groupedFields } for
449
- {responseName}; if no such list exists, create it as an empty list.
450
- - Append {selection} to the {groupForResponseName }.
448
+ - Let {fieldSet } be the list in {groupedFieldSet } for {responseName}; if no
449
+ such list exists, create it as an empty list.
450
+ - Append {selection} to {fieldSet }.
451
451
- If {selection} is a {FragmentSpread}:
452
452
- Let {fragmentSpreadName} be the name of {selection}.
453
453
- If {fragmentSpreadName} is in {visitedFragments}, continue with the next
@@ -464,12 +464,11 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
464
464
- Let {fragmentGroupedFieldSet} be the result of calling
465
465
{CollectFields(objectType, fragmentSelectionSet, variableValues,
466
466
visitedFragments)}.
467
- - For each {fragmentGroup} in {fragmentGroupedFieldSet}:
468
- - Let {responseName} be the response name shared by all fields in
469
- {fragmentGroup}.
470
- - Let {groupForResponseName} be the list in {groupedFields} for
471
- {responseName}; if no such list exists, create it as an empty list.
472
- - Append all items in {fragmentGroup} to {groupForResponseName}.
467
+ - For each {fragmentGroupedFieldSet} as {responseName} and
468
+ {fragmentFieldSet}:
469
+ - Let {fieldSet} be the list in {groupedFieldSet} for {responseName}; if
470
+ no such list exists, create it as an empty list.
471
+ - Append all fields in {fragmentFieldSet} to {fieldSet}.
473
472
- If {selection} is an {InlineFragment}:
474
473
- Let {fragmentType} be the type condition on {selection}.
475
474
- If {fragmentType} is not {null} and {DoesFragmentTypeApply(objectType,
@@ -479,13 +478,12 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
479
478
- Let {fragmentGroupedFieldSet} be the result of calling
480
479
{CollectFields(objectType, fragmentSelectionSet, variableValues,
481
480
visitedFragments)}.
482
- - For each {fragmentGroup} in {fragmentGroupedFieldSet}:
483
- - Let {responseName} be the response name shared by all fields in
484
- {fragmentGroup}.
485
- - Let {groupForResponseName} be the list in {groupedFields} for
486
- {responseName}; if no such list exists, create it as an empty list.
487
- - Append all items in {fragmentGroup} to {groupForResponseName}.
488
- - Return {groupedFields}.
481
+ - For each {fragmentGroupedFieldSet} as {responseName} and
482
+ {fragmentFieldSet}:
483
+ - Let {fieldSet} be the list in {groupedFieldSet} for {responseName}; if
484
+ no such list exists, create it as an empty list.
485
+ - Append all fields in {fragmentFieldSet} to {fieldSet}.
486
+ - Return {groupedFieldSet}.
489
487
490
488
DoesFragmentTypeApply(objectType, fragmentType):
491
489
@@ -534,22 +532,22 @@ After resolving the value for field `"a"`, the following multiple selection sets
534
532
are merged together so ` "subfield1" ` and ` "subfield2" ` are resolved in the same
535
533
phase with the same value.
536
534
537
- CollectSubfields(objectType, fields , variableValues):
535
+ CollectSubfields(objectType, fieldSet , variableValues):
538
536
539
537
- Let {groupedFieldSet} be an empty map.
540
- - For each {field} in {fields }:
538
+ - For each {field} in {fieldSet }:
541
539
- Let {fieldSelectionSet} be the selection set of {field}.
542
540
- If {fieldSelectionSet} is null or empty, continue to the next field.
543
541
- Let {fieldGroupedFieldSet} be the result of {CollectFields(objectType,
544
542
fieldSelectionSet, variableValues)}.
545
543
- For each {fieldGroupedFieldSet} as {responseName} and {subfields}:
546
- - Let {groupForResponseName } be the list in {groupedFieldSet} for
547
- {responseName}; if no such list exists, create it as an empty list.
548
- - Append all fields in {subfields} to {groupForResponseName }.
544
+ - Let {fieldSet } be the list in {groupedFieldSet} for {responseName}; if no
545
+ such list exists, create it as an empty list.
546
+ - Append all fields in {subfields} to {fieldSet }.
549
547
- Return {groupedFieldSet}.
550
548
551
- Note: All the {fields } passed to {CollectSubfields()} share the same _ response
552
- name_ .
549
+ Note: The {fieldSet } passed to {CollectSubfields()} is a _ field set _ , thus they
550
+ share the same _ response name_ .
553
551
554
552
### Executing Collected Fields
555
553
@@ -570,14 +568,14 @@ ExecuteCollectedFields(groupedFieldSet, objectType, objectValue,
570
568
variableValues):
571
569
572
570
- Initialize {resultMap} to an empty ordered map.
573
- - For each {groupedFieldSet} as {responseName} and {fields }:
574
- - Let {fieldName} be the name of the first entry in {fields }. Note: This value
575
- is unaffected if an alias is used.
571
+ - For each {groupedFieldSet} as {responseName} and {fieldSet }:
572
+ - Let {fieldName} be the name of the first entry in {fieldSet }. Note: This
573
+ value is unaffected if an alias is used.
576
574
- Let {fieldType} be the return type defined for the field {fieldName} of
577
575
{objectType}.
578
576
- If {fieldType} is defined:
579
577
- Let {responseValue} be {ExecuteField(objectType, objectValue, fieldType,
580
- fields , variableValues)}.
578
+ fieldSet , variableValues)}.
581
579
- Set {responseValue} as the value for {responseName} in {resultMap}.
582
580
- Return {resultMap}.
583
581
@@ -709,15 +707,15 @@ coerces any provided argument values, then resolves a value for the field, and
709
707
finally completes that value either by recursively executing another selection
710
708
set or coercing a scalar value.
711
709
712
- ExecuteField(objectType, objectValue, fieldType, fields , variableValues):
710
+ ExecuteField(objectType, objectValue, fieldType, fieldSet , variableValues):
713
711
714
- - Let {field} be the first entry in {fields }.
712
+ - Let {field} be the first entry in {fieldSet }.
715
713
- Let {fieldName} be the field name of {field}.
716
714
- Let {argumentValues} be the result of {CoerceArgumentValues(objectType, field,
717
715
variableValues)}.
718
716
- Let {resolvedValue} be {ResolveFieldValue(objectType, objectValue, fieldName,
719
717
argumentValues)}.
720
- - Return the result of {CompleteValue(fieldType, fields , resolvedValue,
718
+ - Return the result of {CompleteValue(fieldType, fieldSet , resolvedValue,
721
719
variableValues)}.
722
720
723
721
### Coercing Field Arguments
@@ -809,12 +807,12 @@ After resolving the value for a field, it is completed by ensuring it adheres to
809
807
the expected return type. If the return type is another Object type, then the
810
808
field execution process continues recursively.
811
809
812
- CompleteValue(fieldType, fields , result, variableValues):
810
+ CompleteValue(fieldType, fieldSet , result, variableValues):
813
811
814
812
- If the {fieldType} is a Non-Null type:
815
813
- Let {innerType} be the inner type of {fieldType}.
816
814
- Let {completedResult} be the result of calling {CompleteValue(innerType,
817
- fields , result, variableValues)}.
815
+ fieldSet , result, variableValues)}.
818
816
- If {completedResult} is {null}, raise an _ execution error_ .
819
817
- Return {completedResult}.
820
818
- If {result} is {null} (or another internal value similar to {null} such as
@@ -823,7 +821,7 @@ CompleteValue(fieldType, fields, result, variableValues):
823
821
- If {result} is not a collection of values, raise an _ execution error_ .
824
822
- Let {innerType} be the inner type of {fieldType}.
825
823
- Return a list where each list item is the result of calling
826
- {CompleteValue(innerType, fields , resultItem, variableValues)}, where
824
+ {CompleteValue(innerType, fieldSet , resultItem, variableValues)}, where
827
825
{resultItem} is each item in {result}.
828
826
- If {fieldType} is a Scalar or Enum type:
829
827
- Return the result of {CoerceResult(fieldType, result)}.
@@ -833,7 +831,7 @@ CompleteValue(fieldType, fields, result, variableValues):
833
831
- Otherwise if {fieldType} is an Interface or Union type.
834
832
- Let {objectType} be {ResolveAbstractType(fieldType, result)}.
835
833
- Let {groupedFieldSet} be the result of calling {CollectSubfields(objectType,
836
- fields , variableValues)}.
834
+ fieldSet , variableValues)}.
837
835
- Return the result of evaluating {ExecuteCollectedFields(groupedFieldSet,
838
836
objectType, result, variableValues)} _ normally_ (allowing for
839
837
parallelization).
0 commit comments