Skip to content

Commit 00a3b11

Browse files
committed
add stream validation for overlapping fields
1 parent a08db1d commit 00a3b11

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

spec/Section 5 -- Validation.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ FieldsInSetCanMerge(set):
413413
{set} including visiting fragments and inline fragments.
414414
* Given each pair of members {fieldA} and {fieldB} in {fieldsForName}:
415415
* {SameResponseShape(fieldA, fieldB)} must be true.
416+
* {SameStreamDirective(fieldA, fieldB)} must be true.
416417
* If the parent types of {fieldA} and {fieldB} are equal or if either is not
417418
an Object Type:
418419
* {fieldA} and {fieldB} must have identical field names.
@@ -446,6 +447,16 @@ SameResponseShape(fieldA, fieldB):
446447
* If {SameResponseShape(subfieldA, subfieldB)} is false, return false.
447448
* Return true.
448449

450+
SameStreamDirective(fieldA, fieldB):
451+
452+
* If neither {fieldA} nor {fieldB} has a directive named `stream`.
453+
* Return true.
454+
* If both {fieldA} and {fieldB} have a directive named `stream`.
455+
* Let {streamA} be the directive named `stream` on {fieldA}.
456+
* Let {streamB} be the directive named `stream` on {fieldB}.
457+
* If {streamA} and {streamB} have identical sets of arguments, return true.
458+
* Return false.
459+
449460
**Explanatory Text**
450461

451462
If multiple field selections with the same response names are encountered

0 commit comments

Comments
 (0)