From e8873fc66ce1b36870665c5ef146b874900d6b3a Mon Sep 17 00:00:00 2001 From: Nick Lucas Date: Thu, 5 Dec 2024 18:09:48 +0000 Subject: [PATCH] Change all types and interfaces to default QueryKey as any --- .../src/infinite-query-options.ts | 4 +-- .../src/inject-queries.ts | 6 +++- .../src/query-options.ts | 4 +-- .../angular-query-experimental/src/types.ts | 6 ++-- packages/query-core/src/query.ts | 6 ++-- packages/query-core/src/types.ts | 34 +++++++++---------- packages/query-core/src/utils.ts | 2 +- .../react-query/src/infiniteQueryOptions.ts | 6 ++-- packages/react-query/src/queryOptions.ts | 6 ++-- packages/react-query/src/types.ts | 10 +++--- packages/react-query/src/useQueries.ts | 2 +- packages/solid-query/src/QueryClient.ts | 4 +-- packages/solid-query/src/createQueries.ts | 2 +- .../solid-query/src/infiniteQueryOptions.ts | 4 +-- packages/solid-query/src/queryOptions.ts | 4 +-- packages/solid-query/src/types.ts | 10 +++--- packages/svelte-query/src/createQueries.ts | 2 +- packages/svelte-query/src/queryOptions.ts | 4 +-- packages/svelte-query/src/types.ts | 6 ++-- .../vue-query/src/infiniteQueryOptions.ts | 4 +-- packages/vue-query/src/useBaseQuery.ts | 2 +- packages/vue-query/src/useInfiniteQuery.ts | 2 +- packages/vue-query/src/useQuery.ts | 6 ++-- 23 files changed, 70 insertions(+), 66 deletions(-) diff --git a/packages/angular-query-experimental/src/infinite-query-options.ts b/packages/angular-query-experimental/src/infinite-query-options.ts index 266df37910..257b40a7b3 100644 --- a/packages/angular-query-experimental/src/infinite-query-options.ts +++ b/packages/angular-query-experimental/src/infinite-query-options.ts @@ -13,7 +13,7 @@ export type UndefinedInitialDataInfiniteOptions< TQueryFnData, TError = DefaultError, TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > = CreateInfiniteQueryOptions< TQueryFnData, @@ -33,7 +33,7 @@ export type DefinedInitialDataInfiniteOptions< TQueryFnData, TError = DefaultError, TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > = CreateInfiniteQueryOptions< TQueryFnData, diff --git a/packages/angular-query-experimental/src/inject-queries.ts b/packages/angular-query-experimental/src/inject-queries.ts index 8f969993d6..da955c1dbc 100644 --- a/packages/angular-query-experimental/src/inject-queries.ts +++ b/packages/angular-query-experimental/src/inject-queries.ts @@ -31,7 +31,7 @@ type QueryObserverOptionsForCreateQueries< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = OmitKeyof< QueryObserverOptions, 'placeholderData' @@ -193,6 +193,10 @@ export type QueriesResults< Array /** + * @param root0 + * @param root0.queries + * @param root0.combine + * @param injector * @public */ export function injectQueries< diff --git a/packages/angular-query-experimental/src/query-options.ts b/packages/angular-query-experimental/src/query-options.ts index 3dc91a6d0a..7daf85d636 100644 --- a/packages/angular-query-experimental/src/query-options.ts +++ b/packages/angular-query-experimental/src/query-options.ts @@ -13,7 +13,7 @@ export type UndefinedInitialDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = CreateQueryOptions & { initialData?: undefined | InitialDataFunction> } @@ -25,7 +25,7 @@ export type DefinedInitialDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = CreateQueryOptions & { initialData: | NonUndefinedGuard diff --git a/packages/angular-query-experimental/src/types.ts b/packages/angular-query-experimental/src/types.ts index 5c0e096457..96e5b70aaf 100644 --- a/packages/angular-query-experimental/src/types.ts +++ b/packages/angular-query-experimental/src/types.ts @@ -25,7 +25,7 @@ export interface CreateBaseQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > extends QueryObserverOptions< TQueryFnData, TError, @@ -41,7 +41,7 @@ export interface CreateQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > extends OmitKeyof< CreateBaseQueryOptions< TQueryFnData, @@ -97,7 +97,7 @@ export interface CreateInfiniteQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > extends OmitKeyof< InfiniteQueryObserverOptions< diff --git a/packages/query-core/src/query.ts b/packages/query-core/src/query.ts index 3485d8ce28..3e2500c4c6 100644 --- a/packages/query-core/src/query.ts +++ b/packages/query-core/src/query.ts @@ -33,7 +33,7 @@ interface QueryConfig< TQueryFnData, TError, TData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > { cache: QueryCache queryKey: TQueryKey @@ -62,7 +62,7 @@ export interface FetchContext< TQueryFnData, TError, TData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > { fetchFn: () => unknown | Promise fetchOptions?: FetchOptions @@ -76,7 +76,7 @@ export interface QueryBehavior< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > { onFetch: ( context: FetchContext, diff --git a/packages/query-core/src/types.ts b/packages/query-core/src/types.ts index ea43533811..360e610bbd 100644 --- a/packages/query-core/src/types.ts +++ b/packages/query-core/src/types.ts @@ -63,7 +63,7 @@ export type DataTag< export type QueryFunction< T = unknown, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = never, > = (context: QueryFunctionContext) => T | Promise @@ -71,21 +71,21 @@ export type StaleTime< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = number | ((query: Query) => number) export type Enabled< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = | boolean | ((query: Query) => boolean) export type QueryPersister< T = unknown, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = never, > = [TPageParam] extends [never] ? ( @@ -100,7 +100,7 @@ export type QueryPersister< ) => T | Promise export type QueryFunctionContext< - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = never, > = [TPageParam] extends [never] ? { @@ -134,7 +134,7 @@ export type PlaceholderDataFunction< TQueryFnData = unknown, TError = DefaultError, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = ( previousData: TQueryData | undefined, previousQuery: Query | undefined, @@ -188,7 +188,7 @@ export interface QueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = never, > { /** @@ -276,7 +276,7 @@ export interface QueryObserverOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = never, > extends WithRequired< QueryOptions, @@ -415,7 +415,7 @@ export type DefaultedQueryObserverOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = WithRequired< QueryObserverOptions, 'throwOnError' | 'refetchOnReconnect' | 'queryHash' @@ -426,7 +426,7 @@ export interface InfiniteQueryObserverOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > extends QueryObserverOptions< TQueryFnData, @@ -443,7 +443,7 @@ export type DefaultedInfiniteQueryObserverOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > = WithRequired< InfiniteQueryObserverOptions< @@ -461,7 +461,7 @@ export interface FetchQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = never, > extends WithRequired< QueryOptions, @@ -479,7 +479,7 @@ export interface EnsureQueryDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = never, > extends FetchQueryOptions< TQueryFnData, @@ -495,7 +495,7 @@ export type EnsureInfiniteQueryDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > = FetchInfiniteQueryOptions< TQueryFnData, @@ -518,7 +518,7 @@ export type FetchInfiniteQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > = Omit< FetchQueryOptions< @@ -552,7 +552,7 @@ export interface InvalidateQueryFilters< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > extends QueryFilters { refetchType?: QueryTypeFilter | 'none' } @@ -561,7 +561,7 @@ export interface RefetchQueryFilters< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > extends QueryFilters {} export interface InvalidateOptions extends RefetchOptions {} diff --git a/packages/query-core/src/utils.ts b/packages/query-core/src/utils.ts index bcc35239f1..e4d32d575b 100644 --- a/packages/query-core/src/utils.ts +++ b/packages/query-core/src/utils.ts @@ -18,7 +18,7 @@ export interface QueryFilters< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > { /** * Filter to active queries, inactive queries or all queries diff --git a/packages/react-query/src/infiniteQueryOptions.ts b/packages/react-query/src/infiniteQueryOptions.ts index d834bd5987..a82d981ddb 100644 --- a/packages/react-query/src/infiniteQueryOptions.ts +++ b/packages/react-query/src/infiniteQueryOptions.ts @@ -13,7 +13,7 @@ export type UndefinedInitialDataInfiniteOptions< TQueryFnData, TError = DefaultError, TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > = UseInfiniteQueryOptions< TQueryFnData, @@ -35,7 +35,7 @@ export type UnusedSkipTokenInfiniteOptions< TQueryFnData, TError = DefaultError, TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > = OmitKeyof< UseInfiniteQueryOptions< @@ -67,7 +67,7 @@ export type DefinedInitialDataInfiniteOptions< TQueryFnData, TError = DefaultError, TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > = UseInfiniteQueryOptions< TQueryFnData, diff --git a/packages/react-query/src/queryOptions.ts b/packages/react-query/src/queryOptions.ts index 714d38a5f7..dfe5f63b24 100644 --- a/packages/react-query/src/queryOptions.ts +++ b/packages/react-query/src/queryOptions.ts @@ -12,7 +12,7 @@ export type UndefinedInitialDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = UseQueryOptions & { initialData?: | undefined @@ -24,7 +24,7 @@ export type UnusedSkipTokenOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = OmitKeyof< UseQueryOptions, 'queryFn' @@ -41,7 +41,7 @@ export type DefinedInitialDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = UseQueryOptions & { initialData: | NonUndefinedGuard diff --git a/packages/react-query/src/types.ts b/packages/react-query/src/types.ts index 8516536361..74b26de3ab 100644 --- a/packages/react-query/src/types.ts +++ b/packages/react-query/src/types.ts @@ -22,7 +22,7 @@ export interface UseBaseQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > extends QueryObserverOptions< TQueryFnData, TError, @@ -35,7 +35,7 @@ export interface UseQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > extends OmitKeyof< UseBaseQueryOptions, 'suspense' @@ -45,7 +45,7 @@ export interface UseSuspenseQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > extends OmitKeyof< UseQueryOptions, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData' @@ -61,7 +61,7 @@ export interface UseInfiniteQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > extends OmitKeyof< InfiniteQueryObserverOptions< @@ -80,7 +80,7 @@ export interface UseSuspenseInfiniteQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > extends OmitKeyof< UseInfiniteQueryOptions< diff --git a/packages/react-query/src/useQueries.ts b/packages/react-query/src/useQueries.ts index 90ef2e32ad..b44915e42c 100644 --- a/packages/react-query/src/useQueries.ts +++ b/packages/react-query/src/useQueries.ts @@ -44,7 +44,7 @@ type UseQueryOptionsForUseQueries< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = OmitKeyof< UseQueryOptions, 'placeholderData' diff --git a/packages/solid-query/src/QueryClient.ts b/packages/solid-query/src/QueryClient.ts index ddbe9927da..e226615b30 100644 --- a/packages/solid-query/src/QueryClient.ts +++ b/packages/solid-query/src/QueryClient.ts @@ -14,7 +14,7 @@ export interface QueryObserverOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = never, > extends OmitKeyof< QueryCoreObserverOptions< @@ -44,7 +44,7 @@ export interface InfiniteQueryObserverOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > extends OmitKeyof< QueryCoreInfiniteQueryObserverOptions< diff --git a/packages/solid-query/src/createQueries.ts b/packages/solid-query/src/createQueries.ts index f4bd50c0dc..7515e7dd87 100644 --- a/packages/solid-query/src/createQueries.ts +++ b/packages/solid-query/src/createQueries.ts @@ -35,7 +35,7 @@ type CreateQueryOptionsForCreateQueries< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = OmitKeyof< SolidQueryOptions, 'placeholderData' | 'suspense' diff --git a/packages/solid-query/src/infiniteQueryOptions.ts b/packages/solid-query/src/infiniteQueryOptions.ts index 95d28d516a..bc09ae1193 100644 --- a/packages/solid-query/src/infiniteQueryOptions.ts +++ b/packages/solid-query/src/infiniteQueryOptions.ts @@ -10,7 +10,7 @@ export type UndefinedInitialDataInfiniteOptions< TQueryFnData, TError = DefaultError, TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > = FunctionedParams< SolidInfiniteQueryOptions< @@ -32,7 +32,7 @@ export type DefinedInitialDataInfiniteOptions< TError = DefaultError, // should we handle page param correctly TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > = FunctionedParams< SolidInfiniteQueryOptions< diff --git a/packages/solid-query/src/queryOptions.ts b/packages/solid-query/src/queryOptions.ts index 50c7d81151..c5f8951e60 100644 --- a/packages/solid-query/src/queryOptions.ts +++ b/packages/solid-query/src/queryOptions.ts @@ -5,7 +5,7 @@ export type UndefinedInitialDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = FunctionedParams< SolidQueryOptions & { initialData?: undefined @@ -16,7 +16,7 @@ export type DefinedInitialDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = FunctionedParams< SolidQueryOptions & { initialData: TQueryFnData | (() => TQueryFnData) diff --git a/packages/solid-query/src/types.ts b/packages/solid-query/src/types.ts index 22d70e8def..17e6fd241b 100644 --- a/packages/solid-query/src/types.ts +++ b/packages/solid-query/src/types.ts @@ -25,7 +25,7 @@ export interface CreateBaseQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > extends OmitKeyof< QueryObserverOptions, 'suspense' @@ -49,7 +49,7 @@ export interface SolidQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > extends CreateBaseQueryOptions< TQueryFnData, TError, @@ -62,7 +62,7 @@ export type CreateQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = FunctionedParams> /* --- Create Query and Create Base Query Types --- */ @@ -93,7 +93,7 @@ export interface SolidInfiniteQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > extends OmitKeyof< InfiniteQueryObserverOptions< @@ -126,7 +126,7 @@ export type CreateInfiniteQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > = FunctionedParams< SolidInfiniteQueryOptions< diff --git a/packages/svelte-query/src/createQueries.ts b/packages/svelte-query/src/createQueries.ts index 2c77a6db4e..ba4ea01121 100644 --- a/packages/svelte-query/src/createQueries.ts +++ b/packages/svelte-query/src/createQueries.ts @@ -25,7 +25,7 @@ type QueryObserverOptionsForCreateQueries< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = OmitKeyof< QueryObserverOptions, 'placeholderData' diff --git a/packages/svelte-query/src/queryOptions.ts b/packages/svelte-query/src/queryOptions.ts index dc4beb2951..9baddb4655 100644 --- a/packages/svelte-query/src/queryOptions.ts +++ b/packages/svelte-query/src/queryOptions.ts @@ -10,7 +10,7 @@ export type UndefinedInitialDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = CreateQueryOptions & { initialData?: undefined | InitialDataFunction> } @@ -21,7 +21,7 @@ export type DefinedInitialDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = CreateQueryOptions & { initialData: | NonUndefinedGuard diff --git a/packages/svelte-query/src/types.ts b/packages/svelte-query/src/types.ts index fb835c5e7b..47531b4e30 100644 --- a/packages/svelte-query/src/types.ts +++ b/packages/svelte-query/src/types.ts @@ -26,7 +26,7 @@ export type CreateBaseQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = QueryObserverOptions /** Result from createBaseQuery */ @@ -40,7 +40,7 @@ export type CreateQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = CreateBaseQueryOptions /** Result from createQuery */ @@ -55,7 +55,7 @@ export type CreateInfiniteQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > = InfiniteQueryObserverOptions< TQueryFnData, diff --git a/packages/vue-query/src/infiniteQueryOptions.ts b/packages/vue-query/src/infiniteQueryOptions.ts index dbe296e1af..f13d93d94f 100644 --- a/packages/vue-query/src/infiniteQueryOptions.ts +++ b/packages/vue-query/src/infiniteQueryOptions.ts @@ -10,7 +10,7 @@ export type UndefinedInitialDataInfiniteOptions< TQueryFnData, TError = DefaultError, TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > = UseInfiniteQueryOptions< TQueryFnData, @@ -29,7 +29,7 @@ export type DefinedInitialDataInfiniteOptions< TQueryFnData, TError = DefaultError, TData = InfiniteData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > = UseInfiniteQueryOptions< TQueryFnData, diff --git a/packages/vue-query/src/useBaseQuery.ts b/packages/vue-query/src/useBaseQuery.ts index 245a073e8b..320f464244 100644 --- a/packages/vue-query/src/useBaseQuery.ts +++ b/packages/vue-query/src/useBaseQuery.ts @@ -41,7 +41,7 @@ type UseQueryOptionsGeneric< TError, TData, TQueryData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > = | UseQueryOptions diff --git a/packages/vue-query/src/useInfiniteQuery.ts b/packages/vue-query/src/useInfiniteQuery.ts index c4a9bcb681..555a5127a8 100644 --- a/packages/vue-query/src/useInfiniteQuery.ts +++ b/packages/vue-query/src/useInfiniteQuery.ts @@ -19,7 +19,7 @@ export type UseInfiniteQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, TPageParam = unknown, > = { [Property in keyof InfiniteQueryObserverOptions< diff --git a/packages/vue-query/src/useQuery.ts b/packages/vue-query/src/useQuery.ts index af3f1ea31d..a079be2e62 100644 --- a/packages/vue-query/src/useQuery.ts +++ b/packages/vue-query/src/useQuery.ts @@ -22,7 +22,7 @@ export type UseQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = MaybeRef< { [Property in keyof QueryObserverOptions< @@ -59,7 +59,7 @@ export type UndefinedInitialQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = UseQueryOptions & { initialData?: undefined } @@ -68,7 +68,7 @@ export type DefinedInitialQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = QueryKey, + TQueryKey extends QueryKey = any, > = UseQueryOptions & { initialData: | NonUndefinedGuard