Glossary #106
Replies: 2 comments 8 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 Incremental Stream Result, followed by one or more Incremental Stream Update Result.
Initial Incremental Stream Result:
ExecutionResult, with the addition of new fields required for incremental delivery,hasNext,pending,incremental,completed.Incremental Stream Update Result:
dataorerrorshasNextpending,incremental,completed.Incremental Pending Notice
pendingarray in an initial execution result or incremental stream update resultIncremental Result
incrementalarray in an initial execution result or incremental stream update resultIncremental Completion Notice
completedarray in an initial execution result or incremental stream update resultBeta Was this translation helpful? Give feedback.
All reactions