Skip to content

Commit 0bcdd92

Browse files
committed
Editorial
1 parent 77c44e2 commit 0bcdd92

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

spec/Section 5 -- Validation.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ fragment conflictingDifferingResponses on Pet {
727727

728728
Fragment spread arguments can also cause fields to fail to merge.
729729

730-
In the following, the arguments to `commandFragment` reference different
730+
In the following, the arguments to {commandFragment} reference different
731731
variables and so cannot merge:
732732

733733
```graphql counter-example
@@ -752,7 +752,7 @@ query {
752752

753753
Though the fragment is referenced consistently as
754754
`...commandFragment(command: $command)` in the following, the position in which
755-
the `$command` variable is defined for each reference differs, and thus the
755+
the ${command} variable is defined for each reference differs, and thus the
756756
arguments do not match:
757757

758758
```graphql counter-example
@@ -1885,8 +1885,8 @@ fragment houseTrainedWithArgument($atOtherHomes: Boolean) on Dog {
18851885
A _fragment variable_ is scoped locally to the fragment that defines it, and
18861886
overrides the _operation variable_ of the same name, if any, so there is never
18871887
ambiguity about which value to use. In the above example, the value of the
1888-
argument `atOtherHomes` within `houseTrained` will be the _operation variable_'s
1889-
value. Within `houseTrainedWithArgument` the argument `atOtherHomes` will not
1888+
argument {atOtherHomes} within {houseTrained} will be the _operation variable_'s
1889+
value. Within {houseTrainedWithArgument} the argument {atOtherHomes} will not
18901890
provide a value, as no value is supplied by the fragment spread in query `C`.
18911891

18921892
### Variables Are Input Types
@@ -2106,7 +2106,7 @@ included in that operation.
21062106
- Let {variables} be the variables defined by that {operation}.
21072107
- Each {variable} in {variables} must be used at least once in either the
21082108
operation scope itself or any fragment transitively referenced by that
2109-
operation, excluding fragments that define the same name as an argument.
2109+
operation, excluding fragments that define the same name as a variable.
21102110
- For every {fragment} in the document:
21112111
- Let {variables} be the variables defined by that {fragment}.
21122112
- Each {variable} in {variables} must be used at least once transitively
@@ -2163,8 +2163,8 @@ fragment isHouseTrainedWithoutVariableFragment on Dog {
21632163
}
21642164
```
21652165

2166-
Fragment arguments can shadow operation variables: fragments that use an
2167-
argument are not using the _operation variable_ of the same name.
2166+
A _fragment variable_ can shadow an _operation variable_: fragments that define
2167+
a variable cannot use the operation variable of the same name (if any).
21682168

21692169
As such, it would be invalid if the operation defined a variable and variables
21702170
of that name were used exclusively inside fragments that define a variable with
@@ -2182,10 +2182,8 @@ fragment shadowedVariableFragment($atOtherHomes: Boolean) on Dog {
21822182
}
21832183
```
21842184

2185-
because
2186-
{$atOtherHomes} is only referenced in a fragment that defines it as a
2187-
locally scoped argument, the _operation variable_ {$atOtherHomes}
2188-
is never used.
2185+
because ${atOtherHomes} is only referenced in a fragment that defines it as a
2186+
locally scoped variable, the _operation variable_ ${atOtherHomes} is never used.
21892187

21902188
All operations in a document must use all of their variables.
21912189

@@ -2227,8 +2225,8 @@ fragment fragmentArgUnused($atOtherHomes: Boolean) on Dog {
22272225
}
22282226
```
22292227

2230-
This document is invalid: fragment `fragmentArgUnused` defines a fragment
2231-
variable `$atOtherHomes`, but this variable is not used within this fragment.
2228+
This document is invalid: fragment {fragmentArgUnused} defines a fragment
2229+
variable ${atOtherHomes}, but this variable is not used within this fragment.
22322230

22332231
### All Variable Usages Are Allowed
22342232

@@ -2238,10 +2236,9 @@ variable `$atOtherHomes`, but this variable is not used within this fragment.
22382236
- Let {variableUsages} be all usages transitively included in the {operation}.
22392237
- For each {variableUsage} in {variableUsages}:
22402238
- Let {variableName} be the name of {variableUsage}.
2241-
- If the usage is within a {fragment} that defines a {variableDefinition}
2239+
- If the usage is within a {fragment} that defines a {VariableDefinition}
22422240
for {variableName}:
2243-
- Let {variableDefinition} be the {VariableDefinition} named
2244-
{variableName} defined within {fragment}.
2241+
- Let {variableDefinition} be that {VariableDefinition}.
22452242
- Otherwise, let {variableDefinition} be the {VariableDefinition} named
22462243
{variableName} defined within {operation}.
22472244
- {IsVariableUsageAllowed(variableDefinition, variableUsage)} must be

0 commit comments

Comments
 (0)