Skip to content

Conversation

@robrichard
Copy link
Contributor

@robrichard robrichard commented Jan 7, 2025

Extracted from the full PR (#1110) and targeting an integration branch to aid in review.

Helpful reference material:

Response format examples: graphql/defer-stream-wg#69
Glossary: graphql/defer-stream-wg#106
GraphQL Conf talk: https://www.youtube.com/watch?v=LEyDeNoobT0

Response types

/** Currently defined types */
type RequestErrorResult = {
  errors: Error[] // request errors only
  extensions?: object
}
type ExecutionResult = {
  data: {} | null
  errors?: Error[] // execution errors only
  extensions?: object
}
type ResponseStream = ExecutionResult[]

/** New types that are yielded by an Incremental Stream */
interface InitialExecutionResult extends ExecutionResult {
  incremental: IncrementalResult[]
  pending?: Pending[]
  completed?: CompletedResult[],
  hasNext?: boolean;
}

type SubsequentExecutionResult = {
  incremental?: IncrementalResult[]
  pending?: Pending[]
  completed?: CompletedResult[],
  hasNext?: boolean;
}

type IncrementalStream = [InitialExecutionResult, ...SubsequentExecutionResult[]];

/** Response is updated to include IncrementalStream as a new member */
type Response = RequestErrorResult | ExecutionResult | ResponseStream | IncrementalStream;

type IncrementalResult = IncrementalObjectResult | IncrementalListResult

yaacovCR pushed a commit to graphql/graphql-js that referenced this pull request Jan 12, 2025
Updated to reflect spec draft
graphql/graphql-spec#1132

Also changed the argument order to match the spec draft
@robrichard robrichard requested a review from benjie January 30, 2025 19:56
Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of nit-picky comments but I think we're pretty close! Do we have a glossary somewhere? I think we need to be really crisp on terms like "result", "response", "payload" and the like.

@robrichard robrichard force-pushed the incremental-integration-type-system branch from d5322ae to 32785b8 Compare February 7, 2025 20:33
@robrichard
Copy link
Contributor Author

@benjie I added a rough glossary here: graphql/defer-stream-wg#106, I'll keep refining it as we go

@robrichard robrichard requested a review from benjie February 24, 2025 19:38
@robrichard robrichard force-pushed the incremental-integration-type-system branch 2 times, most recently from 176172f to 7c0ba73 Compare February 24, 2025 19:42
Copy link
Contributor

@mjmahone mjmahone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look correct to me, I don't think the definition of the @stream/@defer directives have changed in a very long time, so this feels good.

@robrichard robrichard force-pushed the incremental-integration-type-system branch from cf072a4 to 47f362c Compare March 7, 2025 17:07
@robrichard robrichard force-pushed the incremental-integration-type-system branch from 0640179 to b3187e0 Compare April 3, 2025 11:47
@robrichard robrichard changed the base branch from incremental-integration to main April 11, 2025 16:06
@robrichard robrichard changed the base branch from main to incremental-integration April 11, 2025 16:06
@robrichard robrichard force-pushed the incremental-integration-type-system branch from b3187e0 to 3b8799e Compare July 1, 2025 16:06
@robrichard robrichard requested a review from Keweiqu July 1, 2025 16:07
@robrichard robrichard force-pushed the incremental-integration-type-system branch from 3b8799e to 64dc38f Compare July 1, 2025 16:08
Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking really good; all my suggestions are minor except the last one which I think warrants some extra work.

@robrichard robrichard force-pushed the incremental-integration-type-system branch from d1383e4 to f8994fc Compare October 29, 2025 19:41
Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels good to me! Here's some editorial, plus one potentially major change to discuss (making initialCount static)

@robrichard robrichard merged commit 003ed2a into incremental-integration Oct 30, 2025
5 checks passed
@robrichard robrichard deleted the incremental-integration-type-system branch October 30, 2025 19:52
@github-project-automation github-project-automation bot moved this from Planning to review to Done in Benjie's GraphQL tasks Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants