@@ -340,7 +340,8 @@ ExecuteSelectionSet(selectionSet, objectType, objectValue, variableValues):
340
340
- For each {groupedFieldSet} as {responseKey} and {fields}:
341
341
- Let {fieldName} be the name of the first entry in {fields}. Note: This value
342
342
is unaffected if an alias is used.
343
- - Let {fragmentVariableValues} be the fragment-variables value of the first entry in {fields}.
343
+ - Let {fragmentVariableValues} be the fragment-variables value of the first
344
+ entry in {fields}.
344
345
- Let {fieldType} be the return type defined for the field {fieldName} of
345
346
{objectType}.
346
347
- If {fieldType} is defined:
@@ -493,21 +494,22 @@ The depth-first-search order of the field groups produced by {CollectFields()}
493
494
is maintained through execution, ensuring that fields appear in the executed
494
495
response in a stable and predictable order.
495
496
496
- CollectFields(objectType, selectionSet, variableValues, visitedFragments, localVariableValues):
497
+ CollectFields(objectType, selectionSet, variableValues, visitedFragments,
498
+ localVariableValues):
497
499
498
500
- If {visitedFragments} is not provided, initialize it to the empty set.
499
501
- Initialize {groupedFields} to an empty ordered map of lists.
500
502
- For each {selection} in {selectionSet}:
501
503
- If {selection} provides the directive ` @skip ` , let {skipDirective} be that
502
504
directive.
503
505
- If {skipDirective}'s {if} argument is {true} or is a variable in
504
- {localVariableValues} or {variableValues} with the value {true}, continue with the next {selection}
505
- in {selectionSet}.
506
+ {localVariableValues} or {variableValues} with the value {true}, continue
507
+ with the next {selection} in {selectionSet}.
506
508
- If {selection} provides the directive ` @include ` , let {includeDirective} be
507
509
that directive.
508
510
- If {includeDirective}'s {if} argument is not {true} and is not a variable
509
- in {localVariableValues} or {variableValues} with the value {true}, continue with the next
510
- {selection} in {selectionSet}.
511
+ in {localVariableValues} or {variableValues} with the value {true},
512
+ continue with the next {selection} in {selectionSet}.
511
513
- If {selection} is a {Field}:
512
514
- Let {responseKey} be the response key of {selection} (the alias if
513
515
defined, otherwise the field name).
@@ -527,7 +529,8 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments, localV
527
529
- If {DoesFragmentTypeApply(objectType, fragmentType)} is {false}, continue
528
530
with the next {selection} in {selectionSet}.
529
531
- Let {localVariableValues} be the result of calling
530
- {getArgumentValuesFromSpread(selection, fragmentDefinition, variableValues, localVariableValues)}.
532
+ {getArgumentValuesFromSpread(selection, fragmentDefinition,
533
+ variableValues, localVariableValues)}.
531
534
- Let {fragmentGroupedFieldSet} be the result of calling
532
535
{CollectFields(objectType, fragmentSelectionSet, variableValues,
533
536
visitedFragments)}.
@@ -566,24 +569,27 @@ DoesFragmentTypeApply(objectType, fragmentType):
566
569
- If {objectType} is a possible type of {fragmentType}, return {true}
567
570
otherwise return {false}.
568
571
569
- getArgumentValuesFromSpread(fragmentSpread, fragmentDefinition, variableValues, fragmentArgumentValues):
572
+ getArgumentValuesFromSpread(fragmentSpread, fragmentDefinition, variableValues,
573
+ fragmentArgumentValues):
570
574
571
575
- Let {coercedValues} be an empty unordered Map.
572
576
- For each {variableDefinition} in {fragmentDefinition}:
573
577
- Let {variableName} be the name of {variableDefinition}.
574
578
- Let {variableType} be the type of {variableDefinition}.
575
579
- Let {defaultValue} be the default value for {variableDefinition}.
576
- - Let {argumentNode} be the node provided in the fragment-spread for {variableName}
580
+ - Let {argumentNode} be the node provided in the fragment-spread for
581
+ {variableName}
577
582
- If {argumentNode} isn't present or is null
578
583
- If {defaultValue} exists
579
584
- Add an entry to {coercedValues} named {argumentName} with the value
580
585
{defaultValue}.
581
586
- If {variableType} is non-nullable raise a field-error
582
- - Let {hasValue} be {true} if {fragmentArgumentValues} or {variableValues} provides a value for the name
583
- {variableName}.
584
- - If {variableType} is non-nullable and {hasValue} is {false} raise a field-error
585
- - Add an entry to {coercedValues} named {argumentName} with the value
586
- found in {variableValues} or {fragmentArgumentValues}.
587
+ - Let {hasValue} be {true} if {fragmentArgumentValues} or {variableValues}
588
+ provides a value for the name {variableName}.
589
+ - If {variableType} is non-nullable and {hasValue} is {false} raise a
590
+ field-error
591
+ - Add an entry to {coercedValues} named {argumentName} with the value found in
592
+ {variableValues} or {fragmentArgumentValues}.
587
593
- Return {coercedValues}.
588
594
589
595
Note: The steps in {CollectFields()} evaluating the ` @skip ` and ` @include `
@@ -597,7 +603,8 @@ coerces any provided argument values, then resolves a value for the field, and
597
603
finally completes that value either by recursively executing another selection
598
604
set or coercing a scalar value.
599
605
600
- ExecuteField(objectType, objectValue, fieldType, fields, variableValues, fragmentVariableValues):
606
+ ExecuteField(objectType, objectValue, fieldType, fields, variableValues,
607
+ fragmentVariableValues):
601
608
602
609
- Let {field} be the first entry in {fields}.
603
610
- Let {fieldName} be the field name of {field}.
@@ -617,7 +624,8 @@ the type system to have a specific input type.
617
624
At each argument position in an operation may be a literal {Value}, or a
618
625
{Variable} to be provided at runtime.
619
626
620
- CoerceFieldArgumentValues(objectType, field, variableValues, fragmentVariableValues):
627
+ CoerceFieldArgumentValues(objectType, field, variableValues,
628
+ fragmentVariableValues):
621
629
622
630
- Let {argumentValues} be the argument values provided in {field}.
623
631
- Let {fieldName} be the name of {field}.
@@ -626,7 +634,8 @@ CoerceFieldArgumentValues(objectType, field, variableValues, fragmentVariableVal
626
634
- Return {CoerceArgumentValues(argumentDefinitions, argumentValues,
627
635
variableValues, fragmentVariableValues)}
628
636
629
- CoerceArgumentValues(argumentDefinitions, argumentValues, variableValues, fragmentVariableValues):
637
+ CoerceArgumentValues(argumentDefinitions, argumentValues, variableValues,
638
+ fragmentVariableValues):
630
639
631
640
- For each {argumentDefinition} in {argumentDefinitions}:
632
641
- Let {argumentName} be the name of {argumentDefinition}.
@@ -638,8 +647,8 @@ CoerceArgumentValues(argumentDefinitions, argumentValues, variableValues, fragme
638
647
{argumentName}.
639
648
- If {argumentValue} is a {Variable}:
640
649
- Let {variableName} be the name of {argumentValue}.
641
- - Let {hasValue} be {true} if {fragmentVariableValues} provides a value for the name
642
- {variableName}.
650
+ - Let {hasValue} be {true} if {fragmentVariableValues} provides a value for
651
+ the name {variableName}.
643
652
- Let {value} be the value provided in {fragmentVariableValues} for the name
644
653
{variableName}.
645
654
- Let {hasValue} be {true} if {variableValues} provides a value for the name
0 commit comments