Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Benjie <[email protected]>
  • Loading branch information
JoviDeCroock and benjie committed May 20, 2024
1 parent 44aea8b commit 61d2117
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions spec/Section 5 -- Validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,7 @@ query variableIsNotDefined {
${atOtherHomes} is not defined by the operation.

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

Likewise, it would be invalid if the variable was shadowed by a fragment
argument:
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:

```graphql counter-example
query variableNotUsedWithinFragment($atOtherHomes: Boolean) {
Expand Down Expand Up @@ -1982,8 +1981,7 @@ variable.

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

**Explanatory Text**

Expand Down

0 comments on commit 61d2117

Please sign in to comment.