Skip to content

Commit 97db7cd

Browse files
authored
[editorial] Fix formatting of algorithms in Validation section (#671)
1 parent 4d55742 commit 97db7cd

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

spec/Section 5 -- Validation.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,8 @@ fragment directFieldSelectionOnUnion on CatOrDog {
405405
* Let {set} be any selection set defined in the GraphQL document.
406406
* {FieldsInSetCanMerge(set)} must be true.
407407

408-
FieldsInSetCanMerge(set) :
408+
FieldsInSetCanMerge(set):
409+
409410
* Let {fieldsForName} be the set of selections with a given response name in
410411
{set} including visiting fragments and inline fragments.
411412
* Given each pair of members {fieldA} and {fieldB} in {fieldsForName}:
@@ -418,7 +419,8 @@ FieldsInSetCanMerge(set) :
418419
and the selection set of {fieldB}.
419420
* {FieldsInSetCanMerge(mergedSet)} must be true.
420421

421-
SameResponseShape(fieldA, fieldB) :
422+
SameResponseShape(fieldA, fieldB):
423+
422424
* Let {typeA} be the return type of {fieldA}.
423425
* Let {typeB} be the return type of {fieldB}.
424426
* If {typeA} or {typeB} is Non-Null.
@@ -998,15 +1000,16 @@ not defined.
9981000

9991001
* For each {fragmentDefinition} in the document
10001002
* Let {visited} be the empty set.
1001-
* {DetectCycles(fragmentDefinition, visited)}
1003+
* {DetectFragmentCycles(fragmentDefinition, visited)}
1004+
1005+
DetectFragmentCycles(fragmentDefinition, visited):
10021006

1003-
{DetectCycles(fragmentDefinition, visited)} :
10041007
* Let {spreads} be all fragment spread descendants of {fragmentDefinition}
10051008
* For each {spread} in {spreads}
10061009
* {visited} must not contain {spread}
10071010
* Let {nextVisited} be the set including {spread} and members of {visited}
10081011
* Let {nextFragmentDefinition} be the target of {spread}
1009-
* {DetectCycles(nextFragmentDefinition, nextVisited)}
1012+
* {DetectFragmentCycles(nextFragmentDefinition, nextVisited)}
10101013

10111014
**Explanatory Text**
10121015

@@ -1089,7 +1092,8 @@ fragment ownerFragment on Human {
10891092
{GetPossibleTypes(fragmentType)} and {GetPossibleTypes(parentType)}
10901093
* {applicableTypes} must not be empty.
10911094

1092-
GetPossibleTypes(type) :
1095+
GetPossibleTypes(type):
1096+
10931097
* If {type} is an object type, return a set containing {type}
10941098
* If {type} is an interface type, return the set of types implementing {type}
10951099
* If {type} is a union type, return the set of possible types of {type}
@@ -1835,6 +1839,7 @@ an extraneous variable.
18351839
* {IsVariableUsageAllowed(variableDefinition, variableUsage)} must be {true}.
18361840

18371841
IsVariableUsageAllowed(variableDefinition, variableUsage):
1842+
18381843
* Let {variableType} be the expected type of {variableDefinition}.
18391844
* Let {locationType} be the expected type of the {Argument}, {ObjectField},
18401845
or {ListValue} entry where {variableUsage} is located.
@@ -1850,6 +1855,7 @@ IsVariableUsageAllowed(variableDefinition, variableUsage):
18501855
* Return {AreTypesCompatible(variableType, locationType)}.
18511856

18521857
AreTypesCompatible(variableType, locationType):
1858+
18531859
* If {locationType} is a non-null type:
18541860
* If {variableType} is NOT a non-null type, return {false}.
18551861
* Let {nullableLocationType} be the unwrapped nullable type of {locationType}.

0 commit comments

Comments
 (0)