@@ -556,15 +556,13 @@ fragment directFieldSelectionOnUnion on CatOrDog {
556556
557557FieldsInSetCanMerge(set):
558558
559- - Let {visitedSelections} be the selections in {set} including visiting fields,
560- fragment-spreads and inline fragments.
561- - Let {spreadsForName} be the set of fragment spreads with a given name in
562- {visitedSelections}.
563- - For each {spreadsForName} as {name} and {spreads}:
564- - Each entry in {spreads} must have identical sets of arguments to each other
565- entry in {spreads}.
566- - Let {fieldsForName} be the set of field selections with a given response name
567- in {visitedSelections}.
559+ - Let {spreadsForFragment} be the set of fragment spreads for a given named
560+ fragment in {set} including visiting fragments and inline fragments.
561+ - Given each pair of distinct members {spreadA} and {spreadB} in
562+ {spreadsForFragment}:
563+ - {spreadA} and {spreadB} must have identical sets of arguments.
564+ - Let {fieldsForName} be the set of selections with a given _ response name_ in
565+ {set} including visiting fragments and inline fragments.
568566- Given each pair of distinct members {fieldA} and {fieldB} in {fieldsForName}:
569567 - {SameResponseShape(fieldA, fieldB)} must be true.
570568 - If the parent types of {fieldA} and {fieldB} are equal or if either is not
@@ -575,6 +573,13 @@ FieldsInSetCanMerge(set):
575573 the selection set of {fieldB}.
576574 - {FieldsInSetCanMerge(mergedSet)} must be true.
577575
576+ Note: When checking if two fragment spreads or two field selections have
577+ "identical sets of arguments", it is necessary to check both the name of any
578+ variables referenced and also where the variable is defined. For example, if
579+ each selection references the variable ` $size ` , then ` $size ` must either be an
580+ operation variable for both references, or must refer to the same fragment
581+ variable definition for both references.
582+
578583SameResponseShape(fieldA, fieldB):
579584
580585- Let {typeA} be the return type of {fieldA}.
0 commit comments