Glossary #106
Replies: 2 comments 6 replies
-
This currently doesn't take into consideration subscriptions:
Perhaps:
(I've not pluralized "incremental results", because this allows the glossary feature to be used if we move this into the spec.) To help think about this, here's a rough shape of the things I see in TS syntax: /** A regular GraphQL response for a traditional GraphQL query/mutation */
interface Response {
data?: object
errors?: Error[]
}
/** A stream of responses returned from a GraphQL subscription - each event triggers a new response */
type ResponseStream = Response[];
/** A GraphQL operation that uses @stream/@defer may return an "incremental stream": an initial response followed by one more more incremental results */
type IncrementalStream = [InitialResponse, ...IncrementalResult[]];
interface InitialResponse extends Response {
pending: ...
hasNext: true;
}
type IncrementalResult =
| {
incremental: IncrementalSomething[]
pending?: ...
completed?: ...
hasNext?: boolean
}
| { hasNext: false }
interface IncrementalSomething {
...
} Not sure what to call |
Beta Was this translation helpful? Give feedback.
-
What about adding those to the general Glossary? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This discussion will be used to document terms related to incremental delivery being used in the GraphQL Spec text:
Response Format
The Response of a GraphQL request will contain a new union member called incremental stream. An incremental stream is made up of an Initial Execution Result, followed by one or more Execution Update Result.
Initial Execution Result:
ExecutionResult
, with the addition of new fields required for incremental delivery,hasNext
,pending
,incremental
,completed
.Execution Update Result:
data
orerrors
hasNext
pending
,incremental
,completed
.Pending Result
pending
array in an initial execution result or execution update resultIncremental Result
incremental
array in an initial execution result or execution update resultCompleted Result
completed
array in an initial execution result or execution update resultBeta Was this translation helpful? Give feedback.
All reactions