@@ -279,7 +279,10 @@ fragment directFieldSelectionOnUnion on CatOrDog {
279
279
280
280
** Formal Specification **
281
281
282
- * Let {set} be any selection set defined in the GraphQL document
282
+ * Let {set} be any selection set defined in the GraphQL document.
283
+ * {FieldsInSetCanMerge(set)} must be true.
284
+
285
+ FieldsInSetCanMerge(set) :
283
286
* Let {fieldsForName} be the set of selections with a given response name in
284
287
{set} including visiting fragments and inline fragments.
285
288
* Given each pair of members {fieldA} and {fieldB} in {fieldsForName}:
@@ -288,13 +291,16 @@ fragment directFieldSelectionOnUnion on CatOrDog {
288
291
* {fieldA} and {fieldB} must have identical field names.
289
292
* {fieldA} and {fieldB} must have identical return type.
290
293
* {fieldA} and {fieldB} must have identical sets of arguments.
294
+ * Let {mergedSet} be the result of adding the selection set of {fieldA}
295
+ and the selection set of {fieldB}.
296
+ * {FieldsInSetCanMerge(mergedSet)} must be true.
291
297
292
298
** Explanatory Text **
293
299
294
300
If multiple fields selections with the same response names are encountered
295
- during execution, the result should be unambiguous. Therefore any two field
296
- selections which might both be encountered for the same object are only valid if
297
- they are equivalent.
301
+ during execution, the field and arguments to execute and the resulting value
302
+ should be unambiguous. Therefore any two field selections which might both be
303
+ encountered for the same object are only valid if they are equivalent.
298
304
299
305
For simple hand-written GraphQL, this rule is obviously a clear developer error,
300
306
however nested fragments can make this difficult to detect manually.
0 commit comments