Skip to content

Commit 4eaaa4a

Browse files
committed
response key -> response name
1 parent b3cbb53 commit 4eaaa4a

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

spec/Section 2 -- Language.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,9 @@ These two operations are semantically identical:
466466

467467
Alias : Name :
468468

469-
:: A _response key_ is the key in the response object which correlates with a
470-
field's result. By default the response key will use the field's name; however,
471-
you can define a different response key by specifying an alias.
469+
:: A _response name_ is the key in the response object which correlates with a
470+
field's result. By default the response name will use the field's name; however,
471+
you can define a different response name by specifying an alias.
472472

473473
In this example, we can fetch two profile pictures of different sizes and ensure
474474
the resulting response object will not have duplicate keys:

spec/Section 5 -- Validation.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ fragment directFieldSelectionOnUnion on CatOrDog {
418418

419419
FieldsInSetCanMerge(set):
420420

421-
- Let {fieldsForKey} be the set of selections with a given _response key_ in
421+
- Let {fieldsForKey} be the set of selections with a given _response name_ in
422422
{set} including visiting fragments and inline fragments.
423423
- Given each pair of distinct members {fieldA} and {fieldB} in {fieldsForKey}:
424424
- {SameResponseShape(fieldA, fieldB)} must be true.
@@ -450,7 +450,7 @@ SameResponseShape(fieldA, fieldB):
450450
- Assert: {typeB} is an object, union or interface type.
451451
- Let {mergedSet} be the result of adding the selection set of {fieldA} and the
452452
selection set of {fieldB}.
453-
- Let {fieldsForKey} be the set of selections with a given _response key_ in
453+
- Let {fieldsForKey} be the set of selections with a given _response name_ in
454454
{mergedSet} including visiting fragments and inline fragments.
455455
- Given each pair of distinct members {subfieldA} and {subfieldB} in
456456
{fieldsForKey}:
@@ -462,13 +462,13 @@ type that is either an Object, Interface or Union type.
462462

463463
**Explanatory Text**
464464

465-
If multiple field selections with the same _response key_ are encountered during
466-
execution, the field and arguments to execute and the resulting value should be
467-
unambiguous. Therefore any two field selections which might both be encountered
468-
for the same object are only valid if they are equivalent.
465+
If multiple field selections with the same _response name_ are encountered
466+
during execution, the field and arguments to execute and the resulting value
467+
should be unambiguous. Therefore any two field selections which might both be
468+
encountered for the same object are only valid if they are equivalent.
469469

470470
During execution, the simultaneous execution of fields with the same response
471-
key is accomplished by {MergeSelectionSets()} and {CollectFields()}.
471+
name is accomplished by {MergeSelectionSets()} and {CollectFields()}.
472472

473473
For simple hand-written GraphQL, this rule is obviously a clear developer error,
474474
however nested fragments can make this difficult to detect manually.

spec/Section 6 -- Execution.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,8 @@ A correct executor must generate the following result for that _selection set_:
491491

492492
Before execution, the _selection set_ is converted to a grouped field set by
493493
calling {CollectFields()}. Each entry in the grouped field set is a list of
494-
fields that share a _response key_ (the alias if defined, otherwise the field
495-
name). This ensures all fields with the same response key (including those in
494+
fields that share a _response name_ (the alias if defined, otherwise the field
495+
name). This ensures all fields with the same response name (including those in
496496
referenced fragments) are executed at the same time.
497497

498498
As an example, collecting the fields of this selection set would collect two
@@ -534,7 +534,7 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
534534
in {variableValues} with the value {true}, continue with the next
535535
{selection} in {selectionSet}.
536536
- If {selection} is a {Field}:
537-
- Let {responseKey} be the _response key_ of {selection} (the alias if
537+
- Let {responseKey} be the _response name_ of {selection} (the alias if
538538
defined, otherwise the field name).
539539
- Let {groupForResponseKey} be the list in {groupedFields} for
540540
{responseKey}; if no such list exists, create it as an empty list.
@@ -556,7 +556,7 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
556556
{CollectFields(objectType, fragmentSelectionSet, variableValues,
557557
visitedFragments)}.
558558
- For each {fragmentGroup} in {fragmentGroupedFieldSet}:
559-
- Let {responseKey} be the response key shared by all fields in
559+
- Let {responseKey} be the response name shared by all fields in
560560
{fragmentGroup}.
561561
- Let {groupForResponseKey} be the list in {groupedFields} for
562562
{responseKey}; if no such list exists, create it as an empty list.
@@ -571,7 +571,7 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
571571
{CollectFields(objectType, fragmentSelectionSet, variableValues,
572572
visitedFragments)}.
573573
- For each {fragmentGroup} in {fragmentGroupedFieldSet}:
574-
- Let {responseKey} be the response key shared by all fields in
574+
- Let {responseKey} be the response name shared by all fields in
575575
{fragmentGroup}.
576576
- Let {groupForResponseKey} be the list in {groupedFields} for
577577
{responseKey}; if no such list exists, create it as an empty list.

0 commit comments

Comments
 (0)