Skip to content

Commit 61d2117

Browse files
JoviDeCroockbenjie
andcommitted
Apply suggestions from code review
Co-authored-by: Benjie <[email protected]>
1 parent 44aea8b commit 61d2117

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

spec/Section 5 -- Validation.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,7 +1768,7 @@ query variableIsNotDefined {
17681768
${atOtherHomes} is not defined by the operation.
17691769

17701770
Fragments complicate this rule. Any fragment transitively included by an
1771-
operation has access to the variables defined by that operation and defined on
1771+
operation has access to the variables defined by that operation and also those defined on
17721772
the fragment. Fragments can appear within multiple operations and therefore
17731773
variable usages not defined on the fragment must correspond to variable
17741774
definitions in all of those operations.
@@ -1931,8 +1931,7 @@ fragment isHouseTrainedWithoutVariableFragment on Dog {
19311931
Fragment arguments can shadow operation variables: fragments that use an
19321932
argument are not using the operation-defined variable of the same name.
19331933

1934-
Likewise, it would be invalid if the variable was shadowed by a fragment
1935-
argument:
1934+
As such, it would be invalid if the operation defined a variable and variables of that name were used exclusively inside fragments that define a variable with the same name:
19361935

19371936
```graphql counter-example
19381937
query variableNotUsedWithinFragment($atOtherHomes: Boolean) {
@@ -1982,8 +1981,7 @@ variable.
19821981

19831982
- For every {fragment} in the document:
19841983
- Let {variables} be the variables defined by that {fragment}.
1985-
- Each {variable} in {variables} must be used at least once in the fragment's
1986-
scope.
1984+
- Each {variable} in {variables} must be used at least once transitively within the fragment's selection set excluding traversal of named fragment spreads.
19871985

19881986
**Explanatory Text**
19891987

0 commit comments

Comments
 (0)