Skip to content

Commit c1e8e63

Browse files
authored
Clarify: explain response key where referenced (#442)
Ensures a reference to aliases is made when referring to the response key of a selection.
1 parent fd78bf1 commit c1e8e63

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spec/Section 6 -- Execution.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,9 @@ A correct executor must generate the following result for that selection set:
450450

451451
Before execution, the selection set is converted to a grouped field set by
452452
calling {CollectFields()}. Each entry in the grouped field set is a list of
453-
fields that share a response key. This ensures all fields with the same response
454-
key (alias or field name) included via referenced fragments are executed at the
455-
same time.
453+
fields that share a response key (the alias if defined, otherwise the field
454+
name). This ensures all fields with the same response key included via
455+
referenced fragments are executed at the same time.
456456

457457
As an example, collecting the fields of this selection set would collect two
458458
instances of the field `a` and one of field `b`:
@@ -489,7 +489,7 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
489489
* If {includeDirective}'s {if} argument is not {true} and is not a variable in {variableValues} with the value {true}, continue with the next
490490
{selection} in {selectionSet}.
491491
* If {selection} is a {Field}:
492-
* Let {responseKey} be the response key of {selection}.
492+
* Let {responseKey} be the response key of {selection} (the alias if defined, otherwise the field name).
493493
* Let {groupForResponseKey} be the list in {groupedFields} for
494494
{responseKey}; if no such list exists, create it as an empty list.
495495
* Append {selection} to the {groupForResponseKey}.
@@ -509,7 +509,7 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
509509
* Let {fragmentGroupedFieldSet} be the result of calling
510510
{CollectFields(objectType, fragmentSelectionSet, visitedFragments)}.
511511
* For each {fragmentGroup} in {fragmentGroupedFieldSet}:
512-
* Let {responseKey} be the response key shared by all fields in {fragmentGroup}
512+
* Let {responseKey} be the response key shared by all fields in {fragmentGroup}.
513513
* Let {groupForResponseKey} be the list in {groupedFields} for
514514
{responseKey}; if no such list exists, create it as an empty list.
515515
* Append all items in {fragmentGroup} to {groupForResponseKey}.
@@ -520,7 +520,7 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
520520
* Let {fragmentSelectionSet} be the top-level selection set of {selection}.
521521
* Let {fragmentGroupedFieldSet} be the result of calling {CollectFields(objectType, fragmentSelectionSet, variableValues, visitedFragments)}.
522522
* For each {fragmentGroup} in {fragmentGroupedFieldSet}:
523-
* Let {responseKey} be the response key shared by all fields in {fragmentGroup}
523+
* Let {responseKey} be the response key shared by all fields in {fragmentGroup}.
524524
* Let {groupForResponseKey} be the list in {groupedFields} for
525525
{responseKey}; if no such list exists, create it as an empty list.
526526
* Append all items in {fragmentGroup} to {groupForResponseKey}.

0 commit comments

Comments
 (0)