Can a client know when individual streams are complete? #18
Replies: 2 comments 8 replies
-
I think it makes sense to add this into the payload rather than the extension, although I understand it’s no emergency, makes sense to start speculating how we might do that to make sure current implementation doesn’t conflict. i might naively imagine we would just have two different possible payloads, 1) stream payloads and 2) defer payloads (whether from original operation or deferred from stream payloads) where the former have an additional field streamHasNext or streamIsFinal. But sometimes you don’t know the status of whether there is a subsequent stream until after the prior is delivered, and so I imagine that former approach would require a separate payload to signify that the stream is done, otherwise you would have to hold back a payload, which is a no no. So I don’t know if an extra field or extensions field on a payload would work, we would need an entire separate payload (an extensions payload?) which unless built into the spec now, would presumably require breaking changes later. What would the path of that payload be? You can’t usually have repeat paths for stream fields, so that is another aspect that if not standardized now, might break later. Perhaps should be explicitly allowed to have repeat paths? |
Beta Was this translation helpful? Give feedback.
-
Discussed with @mjmahone and others at GraphQL Conf. There was general agreement that this should not be part of the initial defer/stream spec and would benefit from going through its own RFC process. One potential area of discovery is if this could be supported via the schema, i.e. metadata fields on Connections and/or Connection Edges. Another option is a new boolean response field. There was strong preference that the In current proposal, clients should consider streams completed when receiving |
Beta Was this translation helpful? Give feedback.
-
Context
Originally posted by loganfsmyth graphql/graphql-spec#830.
It is not possible to know the status of individual streams if there are multiple fields with
@stream
directives in a single GraphQL operation, only a singlehasNext
field is provided in the payloads.Decision
Not in scope for current spec proposal. Additional exploration needed (potentially using extensions field) to be done for a future enhancement.
Beta Was this translation helpful? Give feedback.
All reactions