Skip to content

Commit

Permalink
add thunk helper type
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacovCR committed Jun 13, 2024
1 parent ff37ebb commit f5be11a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/execution/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,13 @@ export function isNonReconcilableDeferredGroupedFieldSetResult(
return deferredGroupedFieldSetResult.errors !== undefined;
}

type ThunkIncrementalResult<T> =
| BoxedPromiseOrValue<T>
| (() => BoxedPromiseOrValue<T>);

export interface DeferredGroupedFieldSetRecord {
deferredFragmentRecords: ReadonlyArray<DeferredFragmentRecord>;
result:
| BoxedPromiseOrValue<DeferredGroupedFieldSetResult>
| (() => BoxedPromiseOrValue<DeferredGroupedFieldSetResult>);
result: ThunkIncrementalResult<DeferredGroupedFieldSetResult>;
}

export type SubsequentResultRecord = DeferredFragmentRecord | StreamRecord;
Expand All @@ -225,9 +227,7 @@ export interface StreamItemResult {
errors?: ReadonlyArray<GraphQLError> | undefined;
}

export type StreamItemRecord =
| BoxedPromiseOrValue<StreamItemResult>
| (() => BoxedPromiseOrValue<StreamItemResult>);
export type StreamItemRecord = ThunkIncrementalResult<StreamItemResult>;

export interface StreamRecord {
path: Path;
Expand Down

0 comments on commit f5be11a

Please sign in to comment.