diff --git a/types/index.d.ts b/types/index.d.ts index d638c7eb63..4679deb8a4 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -604,7 +604,7 @@ export interface CachedQuery { config: QueryOptions state: CachedQueryState setData( - dataOrUpdater: unknown | ((oldData: unknown | undefined) => unknown) + dataOrUpdater: unknown | undefined | ((oldData: unknown | undefined) => unknown | undefined) ): void clear(): void } @@ -686,7 +686,7 @@ export interface QueryCache { getQueryData(key: AnyQueryKey | string): T | undefined setQueryData( key: AnyQueryKey | string, - dataOrUpdater: T | ((oldData: T | undefined) => T) + dataOrUpdater: T | undefined | ((oldData: T | undefined) => T | undefined) ): void refetchQueries( queryKeyOrPredicateFn: