@@ -1846,14 +1846,14 @@ two operations reference the same fragment, it might actually be necessary:
18461846
18471847``` graphql example
18481848query A ($atOtherHomes : Boolean ) {
1849- ... HouseTrainedFragment
1849+ ... houseTrained
18501850}
18511851
18521852query B ($atOtherHomes : Boolean ) {
1853- ... HouseTrainedFragment
1853+ ... houseTrained
18541854}
18551855
1856- fragment HouseTrainedFragment on Query {
1856+ fragment houseTrained on Query {
18571857 dog {
18581858 isHouseTrained (atOtherHomes : $atOtherHomes )
18591859 }
@@ -1865,29 +1865,29 @@ also defined on an operation:
18651865
18661866``` graphql example
18671867query C ($atOtherHomes : Boolean ) {
1868- ... HouseTrainedFragment
1868+ ... houseTrained
18691869 aDog : dog {
1870- ... HouseTrainedDog
1870+ ... houseTrainedWithArgument
18711871 }
18721872}
18731873
1874- fragment HouseTrainedFragment on Query {
1874+ fragment houseTrained on Query {
18751875 dog {
18761876 isHouseTrained (atOtherHomes : $atOtherHomes )
18771877 }
18781878}
18791879
1880- fragment HouseTrainedDog ($atOtherHomes : Boolean ) on Dog {
1880+ fragment houseTrainedWithArgument ($atOtherHomes : Boolean ) on Dog {
18811881 isHouseTrained (atOtherHomes : $atOtherHomes )
18821882}
18831883```
18841884
18851885A _ fragment variable_ is scoped locally to the fragment that defines it, and
18861886overrides the _ operation variable_ of the same name, if any, so there is never
1887- ambiguity about which value to use. In this case , the value of the argument
1888- ` atOtherHomes ` within ` HouseTrainedFragment ` will be the operation-set value,
1889- and within ` HouseTrainedDog ` will default to being unset (unless a default-value
1890- applies) , as the argument is not set by the fragment spread in the query ` C ` .
1887+ ambiguity about which value to use. In the above example , the value of the
1888+ argument ` atOtherHomes ` within ` houseTrained ` will be the _ operation variable _ 's
1889+ value. Within ` houseTrainedWithArgument ` the argument ` atOtherHomes ` will not
1890+ provide a value , as no value is supplied by the fragment spread in query ` C ` .
18911891
18921892### Variables Are Input Types
18931893
0 commit comments