Overlapping fields with @stream #11
robrichard
announced in
Architectural Decision Records
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context
It is possible to request the same field from different fragments. Normally these overlapping fields are collapsed by the graphql executor. What happens when
@stream
is added to normally overlapping fields?We originally implemented execution behavior that attempted to resolve overlapping streamed fields to something that satisfied the arguments of all stream directives on that field. We received guidance from facebook recommending a validation rule to forbid this (see discussion graphql/graphql-js#2319 (comment))
Decision
We implemented the
SameStreamDirective
validation rule, which disallows overlapping fields with stream directives with different arguments.Consequences
Developers who wish to create multiple streams on the same field, or to both stream and not stream, can use field aliases to ensure the incompatible fields do not overlap.
Status
Beta Was this translation helpful? Give feedback.
All reactions