defer/stream payloads in the initial response #60
robrichard
announced in
Architectural Decision Records
Replies: 1 comment 2 replies
-
My current opinion is that the spec should allow defer/stream payloads in the initial response (and therefore clients must support parsing them), but with a note warning against pitfalls. The quoted section of the algorithm can be prefaced with an RFC2119 May/Optional. I think graphql-js shouldn't include defer/stream payloads in the initial response. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context
In #41 the WG decided that defer/stream payloads will be sent inside of an
incremental
array. Thisincremental
array can be sent in either the initial or subsequent payloads.Example
Response 1:
Response 2
Currently the spec PR includes the "incremental" entry when possible within the initial response:
With a naive server, including defer/stream payloads in the initial response could lead to worse performance than either ignoring the defer/stream or putting it in a later response. If there's a large amount of data that's ready synchronously, the entire payload could be slowed down during transport. But there could be good reasons to support it (maybe it makes sense for a caching proxy?).
Beta Was this translation helpful? Give feedback.
All reactions