Skip to content

Commit 2e541bb

Browse files
JoviDeCroockbenjie
andcommitted
Apply Benjie's suggestions
Co-authored-by: Benjie <[email protected]>
1 parent e027a4f commit 2e541bb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

spec/Section 2 -- Language.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,9 +1220,9 @@ size `60`:
12201220
**Variable Use Within Fragments**
12211221

12221222
Variables can be used within fragments. Operation-defined variables have global
1223-
scope with a given operation. Fragment-defined variables have local scope within the
1224-
fragment definition they are defined in. A variable used within a fragment must either
1225-
be declared in any top-level operation that transitively consumes that fragment,
1223+
scope within a given operation. Fragment-defined variables have local scope within the
1224+
fragment definition in which they are defined. A variable used within a fragment must either
1225+
be declared in each top-level operation that transitively consumes that fragment,
12261226
or by that same fragment as a fragment variable definition. If a variable
12271227
referenced in a fragment is included by an operation where neither the fragment
12281228
nor the operation defines that variable, that operation is invalid (see
@@ -1237,7 +1237,7 @@ For example, the profile picture may need to be a different size depending on
12371237
the parent context:
12381238

12391239
```graphql example
1240-
query withFragmentArguments {
1240+
query userAndFriends {
12411241
user(id: 4) {
12421242
...dynamicProfilePic(size: 100)
12431243
friends(first: 10) {
@@ -1260,7 +1260,7 @@ A fragment-defined variable is scoped to the fragment that defines it.
12601260
Fragment-defined variables are allowed to shadow operation-defined variables.
12611261

12621262
```graphql example
1263-
query withShadowedVariables($size: Int) {
1263+
query withShadowedVariables($size: Int!) {
12641264
user(id: 4) {
12651265
...variableProfilePic
12661266
}
@@ -1279,10 +1279,10 @@ fragment dynamicProfilePic($size: Int!) on User {
12791279
```
12801280

12811281
The profilePic for `user` will be determined by the variables set by the
1282-
operation, while `secondUser` will always have a profilePic of size 10. In this
1282+
operation, while `secondUser` will always have a `profilePic` of size `10`. In this
12831283
case, the fragment `variableProfilePic` uses the operation-defined variable,
12841284
while `dynamicProfilePic` uses the value passed in via the fragment spread's
1285-
argument `size`.
1285+
`size` argument.
12861286

12871287
## Type References
12881288

0 commit comments

Comments
 (0)