hasNext
on single response results
#57
robrichard
announced in
Architectural Decision Records
Replies: 1 comment 2 replies
-
We discussed this at the October WG and the general consensus is that we should require that |
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
With the introduction of the
@defer
and@stream
directives we have a new top level response field calledhasNext
(see #5). This field will be mandatory when GraphQL sends multiple responses as a result of @defer and @stream.The purpose of this discussion is to determine what the behavior of
hasNext
should be when the server sends only a single response, i.e. nothing is deferred or streamed.Currently, the spec proposal says:
GraphQL-JS also currently does not return
hasNext
when the execution result is only a single response.@IvanGoncharov has proposed that going forward GraphQL servers should always return
hasNext: false
when the execution result is only a single response, to have a more stable shape of responses overall. We would change the spec text to more strongly encourage servers to returnhasNext
on all responses. But since servers that implement an older version of the spec will not send hasNext, we should ensure the spec is clear that clients do not rely on its presence.For example:
Decision
We discussed this at the October WG and the general consensus is that we should require that hasNext be omitted on single responses. The referenced line in the spec has been updated to
Beta Was this translation helpful? Give feedback.
All reactions