@@ -1283,20 +1283,28 @@ size `60`:
12831283
12841284** Variable Use Within Fragments**
12851285
1286- Variables can be used within fragments. Operation-defined variables have global
1287- scope within a given operation. Fragment-defined variables have local scope
1288- within the fragment definition in which they are defined. A variable used within
1289- a fragment must either be declared in each top-level operation that transitively
1290- consumes that fragment, or by that same fragment as a fragment variable
1291- definition. If a variable referenced in a fragment is included by an operation
1292- where neither the fragment nor the operation defines that variable, that
1293- operation is invalid (see
1294- [ All Variable Uses Defined] ( #sec-All-Variable-Uses-Defined ) ).
1286+ Variables can be used within fragments.
1287+
1288+ :: An _ operation variable_ is a variable defined on an operation. An operation
1289+ variable has global scope within that operation, including within any fragments
1290+ that operation transitively consumes.
1291+
1292+ :: A _ fragment variable_ is a variable defined on a fragment. A fragment
1293+ variable is locally scoped, it may only be referenced within that fragment
1294+ (non-transitively).
1295+
1296+ A variable used within a fragment must either be defined by that fragment, or
1297+ must be declared in each top-level operation that transitively consumes that
1298+ fragment. If a variable referenced in a fragment is defined in both the fragment
1299+ and the operation, the fragment definition will be used. If a variable is
1300+ referenced in a fragment and is not defined by that fragment, then any operation
1301+ that transitively references the fragment and does not define that variable is
1302+ invalid (see [ All Variable Uses Defined] ( #sec-All-Variable-Uses-Defined ) ).
12951303
12961304## Fragment Variable Definitions
12971305
1298- Fragments may define locally scoped variables. This allows fragments to be
1299- reused while enabling the caller to specify the fragment's behavior.
1306+ Fragments may define locally scoped variables. This allows the caller to specify
1307+ the fragment's behavior.
13001308
13011309For example, the profile picture may need to be a different size depending on
13021310the parent context:
@@ -1321,8 +1329,8 @@ fragment dynamicProfilePic($size: Int! = 50) on User {
13211329In this case the ` user ` will have a larger ` profilePic ` than those found in the
13221330list of ` friends ` .
13231331
1324- A fragment-defined variable is scoped to the fragment that defines it.
1325- Fragment-defined variables are allowed to shadow operation-defined variables .
1332+ A _ fragment variable _ is scoped to the fragment that defines it. A fragment
1333+ variable may shadow an _ operation variable _ .
13261334
13271335``` graphql example
13281336query withShadowedVariables ($size : Int ! ) {
@@ -1345,9 +1353,9 @@ fragment dynamicProfilePic($size: Int!) on User {
13451353
13461354The profilePic for ` user ` will be determined by the variables set by the
13471355operation, while ` secondUser ` will always have a ` profilePic ` of size ` 10 ` . In
1348- this case, the fragment ` variableProfilePic ` uses the operation-defined
1349- variable, while ` dynamicProfilePic ` uses the value passed in via the fragment
1350- spread's ` size ` argument.
1356+ this case, the fragment ` variableProfilePic ` uses the _ operation variable _ ,
1357+ while ` dynamicProfilePic ` uses the value passed in via the fragment spread's
1358+ ` size ` argument.
13511359
13521360## Type References
13531361
0 commit comments