From f6b8f95b1fd81b57791ef9ae96d7d695d4582d34 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..58e2950abd7f 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 @@ -199,8 +199,9 @@ export type SuspendingSuccessProps = React.PropsWithChildren< export type NonSuspenseCellQueryResult< TVariables extends OperationVariables = any, + TData = any, > = Partial< - Omit, 'loading' | 'error' | 'data'> + Omit, 'loading' | 'error' | 'data'> > // We call this queryResult in createCell, sadly a very overloaded term