Skip to content

Commit 125fb6c

Browse files
committed
add stream validation for overlapping fields
1 parent a077309 commit 125fb6c

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
@@ -411,6 +411,7 @@ FieldsInSetCanMerge(set):
411411
{set} including visiting fragments and inline fragments.
412412
* Given each pair of members {fieldA} and {fieldB} in {fieldsForName}:
413413
* {SameResponseShape(fieldA, fieldB)} must be true.
414+
* {SameStreamDirective(fieldA, fieldB)} must be true.
414415
* If the parent types of {fieldA} and {fieldB} are equal or if either is not
415416
an Object Type:
416417
* {fieldA} and {fieldB} must have identical field names.
@@ -444,6 +445,16 @@ SameResponseShape(fieldA, fieldB):
444445
* If {SameResponseShape(subfieldA, subfieldB)} is false, return false.
445446
* Return true.
446447

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

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

0 commit comments

Comments
 (0)