Skip to content

Commit 15d7f5c

Browse files
committed
Fix names in algorithms
1 parent 4eaaa4a commit 15d7f5c

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

spec/Section 5 -- Validation.md

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

419419
FieldsInSetCanMerge(set):
420420

421-
- Let {fieldsForKey} be the set of selections with a given _response name_ in
421+
- Let {fieldsForName} be the set of selections with a given _response name_ in
422422
{set} including visiting fragments and inline fragments.
423-
- Given each pair of distinct members {fieldA} and {fieldB} in {fieldsForKey}:
423+
- Given each pair of distinct members {fieldA} and {fieldB} in {fieldsForName}:
424424
- {SameResponseShape(fieldA, fieldB)} must be true.
425425
- If the parent types of {fieldA} and {fieldB} are equal or if either is not
426426
an Object Type:
@@ -450,10 +450,10 @@ 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 name_ in
453+
- Let {fieldsForName} 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
456-
{fieldsForKey}:
456+
{fieldsForName}:
457457
- If {SameResponseShape(subfieldA, subfieldB)} is {false}, return {false}.
458458
- Return {true}.
459459

spec/Section 6 -- Execution.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -363,15 +363,15 @@ ExecuteSelectionSet(selectionSet, objectType, objectValue, variableValues):
363363
- Let {groupedFieldSet} be the result of {CollectFields(objectType,
364364
selectionSet, variableValues)}.
365365
- Initialize {resultMap} to an empty ordered map.
366-
- For each {groupedFieldSet} as {responseKey} and {fields}:
366+
- For each {groupedFieldSet} as {responseName} and {fields}:
367367
- Let {fieldName} be the name of the first entry in {fields}. Note: This value
368368
is unaffected if an alias is used.
369369
- Let {fieldType} be the return type defined for the field {fieldName} of
370370
{objectType}.
371371
- If {fieldType} is defined:
372372
- Let {responseValue} be {ExecuteField(objectType, objectValue, fieldType,
373373
fields, variableValues)}.
374-
- Set {responseValue} as the value for {responseKey} in {resultMap}.
374+
- Set {responseValue} as the value for {responseName} in {resultMap}.
375375
- Return {resultMap}.
376376

377377
Note: {resultMap} is ordered by which fields appear first in the operation. This
@@ -534,11 +534,11 @@ 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 name_ of {selection} (the alias if
537+
- Let {responseName} be the _response name_ of {selection} (the alias if
538538
defined, otherwise the field name).
539-
- Let {groupForResponseKey} be the list in {groupedFields} for
540-
{responseKey}; if no such list exists, create it as an empty list.
541-
- Append {selection} to the {groupForResponseKey}.
539+
- Let {groupForResponseName} be the list in {groupedFields} for
540+
{responseName}; if no such list exists, create it as an empty list.
541+
- Append {selection} to the {groupForResponseName}.
542542
- If {selection} is a {FragmentSpread}:
543543
- Let {fragmentSpreadName} be the name of {selection}.
544544
- If {fragmentSpreadName} is in {visitedFragments}, continue with the next
@@ -556,11 +556,11 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
556556
{CollectFields(objectType, fragmentSelectionSet, variableValues,
557557
visitedFragments)}.
558558
- For each {fragmentGroup} in {fragmentGroupedFieldSet}:
559-
- Let {responseKey} be the response name shared by all fields in
559+
- Let {responseName} be the response name shared by all fields in
560560
{fragmentGroup}.
561-
- Let {groupForResponseKey} be the list in {groupedFields} for
562-
{responseKey}; if no such list exists, create it as an empty list.
563-
- Append all items in {fragmentGroup} to {groupForResponseKey}.
561+
- Let {groupForResponseName} be the list in {groupedFields} for
562+
{responseName}; if no such list exists, create it as an empty list.
563+
- Append all items in {fragmentGroup} to {groupForResponseName}.
564564
- If {selection} is an {InlineFragment}:
565565
- Let {fragmentType} be the type condition on {selection}.
566566
- If {fragmentType} is not {null} and {DoesFragmentTypeApply(objectType,
@@ -571,11 +571,11 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
571571
{CollectFields(objectType, fragmentSelectionSet, variableValues,
572572
visitedFragments)}.
573573
- For each {fragmentGroup} in {fragmentGroupedFieldSet}:
574-
- Let {responseKey} be the response name shared by all fields in
574+
- Let {responseName} be the response name shared by all fields in
575575
{fragmentGroup}.
576-
- Let {groupForResponseKey} be the list in {groupedFields} for
577-
{responseKey}; if no such list exists, create it as an empty list.
578-
- Append all items in {fragmentGroup} to {groupForResponseKey}.
576+
- Let {groupForResponseName} be the list in {groupedFields} for
577+
{responseName}; if no such list exists, create it as an empty list.
578+
- Append all items in {fragmentGroup} to {groupForResponseName}.
579579
- Return {groupedFields}.
580580

581581
DoesFragmentTypeApply(objectType, fragmentType):

0 commit comments

Comments
 (0)