Skip to content

Commit 7cad383

Browse files
JoviDeCroockbenjie
andauthored
Apply Benjie's suggestions
Co-authored-by: Benjie <[email protected]>
1 parent 78b5c56 commit 7cad383

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

spec/Section 2 -- Language.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1216,9 +1216,9 @@ size `60`:
12161216
**Variable Use Within Fragments**
12171217

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

12351235
```graphql example
1236-
query withFragmentArguments {
1236+
query userAndFriends {
12371237
user(id: 4) {
12381238
...dynamicProfilePic(size: 100)
12391239
friends(first: 10) {
@@ -1256,7 +1256,7 @@ A fragment-defined variable is scoped to the fragment that defines it.
12561256
Fragment-defined variables are allowed to shadow operation-defined variables.
12571257

12581258
```graphql example
1259-
query withShadowedVariables($size: Int) {
1259+
query withShadowedVariables($size: Int!) {
12601260
user(id: 4) {
12611261
...variableProfilePic
12621262
}
@@ -1275,10 +1275,10 @@ fragment dynamicProfilePic($size: Int!) on User {
12751275
```
12761276

12771277
The profilePic for `user` will be determined by the variables set by the
1278-
operation, while `secondUser` will always have a profilePic of size 10. In this
1278+
operation, while `secondUser` will always have a `profilePic` of size `10`. In this
12791279
case, the fragment `variableProfilePic` uses the operation-defined variable,
12801280
while `dynamicProfilePic` uses the value passed in via the fragment spread's
1281-
argument `size`.
1281+
`size` argument.
12821282

12831283
## Type References
12841284

0 commit comments

Comments
 (0)