hasNext field on GraphQL responses #5
robrichard
announced in
Architectural Decision Records
Replies: 1 comment 2 replies
-
Linking to #54 (reply in thread) Generally, I think this discussion should be reopened now that the graphql-over-http specification has matured and we can rely on a more robust transport specification to manage the concerns mentioned above. As mentioned at the link:
|
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context
GraphQL clients may need to know if additional payloads will be sent by the server. Relay/Facebook used a
is_final
field in extensions for this.Decision
hasNext
, which is present on all payloads when more than one payload will be sent. The final payload will containhasNext: false
, all others will containhasNext: true
.hasNext: true
indicates that there will be an additional response, not necessarily additional data. An empty payload withhasNext: true
is valid and will be sent when the final payload is from a streamed field where it is not known synchronously if more data is present.hasNext: false
indicates that the payload is the final result from an individual source stream event.Consequences
is_final
field due to issues they ran into: clients that were expectingis_final
would fail when connecting to servers that did not support it.Status
Beta Was this translation helpful? Give feedback.
All reactions