@@ -362,15 +362,15 @@ ExecuteSelectionSet(selectionSet, objectType, objectValue, variableValues):
362
362
- Let {groupedFieldSet} be the result of {CollectFields(objectType,
363
363
selectionSet, variableValues)}.
364
364
- Initialize {resultMap} to an empty ordered map.
365
- - For each {groupedFieldSet} as {responseKey } and {fields}:
365
+ - For each {groupedFieldSet} as {responseName } and {fields}:
366
366
- Let {fieldName} be the name of the first entry in {fields}. Note: This value
367
367
is unaffected if an alias is used.
368
368
- Let {fieldType} be the return type defined for the field {fieldName} of
369
369
{objectType}.
370
370
- If {fieldType} is defined:
371
371
- Let {responseValue} be {ExecuteField(objectType, objectValue, fieldType,
372
372
fields, variableValues)}.
373
- - Set {responseValue} as the value for {responseKey } in {resultMap}.
373
+ - Set {responseValue} as the value for {responseName } in {resultMap}.
374
374
- Return {resultMap}.
375
375
376
376
Note: {resultMap} is ordered by which fields appear first in the operation. This
@@ -496,8 +496,8 @@ A correct executor must generate the following result for that _selection set_:
496
496
497
497
Before execution, the _ selection set_ is converted to a grouped field set by
498
498
calling {CollectFields()}. Each entry in the grouped field set is a list of
499
- fields that share a response key (the alias if defined, otherwise the field
500
- name). This ensures all fields with the same response key (including those in
499
+ fields that share a _ response name _ (the alias if defined, otherwise the field
500
+ name). This ensures all fields with the same response name (including those in
501
501
referenced fragments) are executed at the same time.
502
502
503
503
As an example, collecting the fields of this selection set would collect two
@@ -539,11 +539,11 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
539
539
in {variableValues} with the value {true}, continue with the next
540
540
{selection} in {selectionSet}.
541
541
- If {selection} is a {Field}:
542
- - Let {responseKey } be the response key of {selection} (the alias if
542
+ - Let {responseName } be the _ response name _ of {selection} (the alias if
543
543
defined, otherwise the field name).
544
- - Let {groupForResponseKey } be the list in {groupedFields} for
545
- {responseKey }; if no such list exists, create it as an empty list.
546
- - Append {selection} to the {groupForResponseKey }.
544
+ - Let {groupForResponseName } be the list in {groupedFields} for
545
+ {responseName }; if no such list exists, create it as an empty list.
546
+ - Append {selection} to the {groupForResponseName }.
547
547
- If {selection} is a {FragmentSpread}:
548
548
- Let {fragmentSpreadName} be the name of {selection}.
549
549
- If {fragmentSpreadName} is in {visitedFragments}, continue with the next
@@ -561,11 +561,11 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
561
561
{CollectFields(objectType, fragmentSelectionSet, variableValues,
562
562
visitedFragments)}.
563
563
- For each {fragmentGroup} in {fragmentGroupedFieldSet}:
564
- - Let {responseKey } be the response key shared by all fields in
564
+ - Let {responseName } be the response name shared by all fields in
565
565
{fragmentGroup}.
566
- - Let {groupForResponseKey } be the list in {groupedFields} for
567
- {responseKey }; if no such list exists, create it as an empty list.
568
- - Append all items in {fragmentGroup} to {groupForResponseKey }.
566
+ - Let {groupForResponseName } be the list in {groupedFields} for
567
+ {responseName }; if no such list exists, create it as an empty list.
568
+ - Append all items in {fragmentGroup} to {groupForResponseName }.
569
569
- If {selection} is an {InlineFragment}:
570
570
- Let {fragmentType} be the type condition on {selection}.
571
571
- If {fragmentType} is not {null} and {DoesFragmentTypeApply(objectType,
@@ -576,11 +576,11 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
576
576
{CollectFields(objectType, fragmentSelectionSet, variableValues,
577
577
visitedFragments)}.
578
578
- For each {fragmentGroup} in {fragmentGroupedFieldSet}:
579
- - Let {responseKey } be the response key shared by all fields in
579
+ - Let {responseName } be the response name shared by all fields in
580
580
{fragmentGroup}.
581
- - Let {groupForResponseKey } be the list in {groupedFields} for
582
- {responseKey }; if no such list exists, create it as an empty list.
583
- - Append all items in {fragmentGroup} to {groupForResponseKey }.
581
+ - Let {groupForResponseName } be the list in {groupedFields} for
582
+ {responseName }; if no such list exists, create it as an empty list.
583
+ - Append all items in {fragmentGroup} to {groupForResponseName }.
584
584
- Return {groupedFields}.
585
585
586
586
DoesFragmentTypeApply(objectType, fragmentType):
0 commit comments