From bbd395879eebc558f1ecdb024a6d11449add0afd Mon Sep 17 00:00:00 2001 From: Richard Jacquier Date: Thu, 26 Sep 2024 16:39:16 +1000 Subject: [PATCH] fix(web) type NonSuspenseCellQueryResult... Pass through `TData`, instead of `any` --- packages/web/src/components/cell/cellTypes.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/web/src/components/cell/cellTypes.ts b/packages/web/src/components/cell/cellTypes.ts index bc6d9a8318ab..ec9f6186d9e7 100644 --- a/packages/web/src/components/cell/cellTypes.ts +++ b/packages/web/src/components/cell/cellTypes.ts @@ -52,11 +52,11 @@ export type CellProps< > export type CellLoadingProps = { - queryResult?: NonSuspenseCellQueryResult | SuspenseCellQueryResult + queryResult?: NonSuspenseCellQueryResult | SuspenseCellQueryResult } export type CellFailureProps = { - queryResult?: NonSuspenseCellQueryResult | SuspenseCellQueryResult + queryResult?: NonSuspenseCellQueryResult | SuspenseCellQueryResult error?: QueryOperationResult['error'] | Error // for tests and storybook /** @@ -106,7 +106,7 @@ export type CellSuccessProps< TData = any, TVariables extends OperationVariables = any, > = { - queryResult?: NonSuspenseCellQueryResult | SuspenseCellQueryResult + queryResult?: NonSuspenseCellQueryResult | SuspenseCellQueryResult updating?: boolean } & A.Compute> // pre-computing makes the types more readable on hover @@ -198,9 +198,10 @@ export type SuspendingSuccessProps = React.PropsWithChildren< } export type NonSuspenseCellQueryResult< + TData = any, TVariables extends OperationVariables = any, > = Partial< - Omit, 'loading' | 'error' | 'data'> + Omit, 'loading' | 'error' | 'data'> > // We call this queryResult in createCell, sadly a very overloaded term