Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

useQuery

function useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "initialData"> & {
initialData?: () => undefined;
}
): UseQueryResult<TData, TError>;
function useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "initialData"> & {
initialData: TQueryFnData | (() => TQueryFnData);
}
): DefinedUseQueryResult<TData, TError>;
function useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>): UseQueryResult<TData, TError>;
function useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey" | "initialData"> & {
initialData?: () => undefined;
}
): UseQueryResult<TData, TError>;
function useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey" | "initialData"> & {
initialData: TQueryFnData | (() => TQueryFnData);
}
): DefinedUseQueryResult<TData, TError>;
function useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey">): UseQueryResult<TData, TError>;
function useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(
queryKey: TQueryKey,
queryFn: QueryFunction<TQueryFnData, TQueryKey>,
options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey" | "queryFn" | "initialData"> & {
initialData?: () => undefined;
}
,
): UseQueryResult<TData, TError>;
function useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(
queryKey: TQueryKey,
queryFn: QueryFunction<TQueryFnData, TQueryKey>,
options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey" | "queryFn" | "initialData"> & {
initialData: TQueryFnData | (() => TQueryFnData);
}
,
): DefinedUseQueryResult<TData, TError>;
function useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(
queryKey: TQueryKey,
queryFn: QueryFunction<TQueryFnData, TQueryKey>,
options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey" | "queryFn">,
): UseQueryResult<TData, TError>;
§
useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "initialData"> & {
initialData?: () => undefined;
}
): UseQueryResult<TData, TError>
[src]

§Type Parameters

§
TQueryFnData = unknown
[src]
§
TError = unknown
[src]
§
TData = TQueryFnData
[src]
§
TQueryKey extends QueryKey = QueryKey
[src]

§Parameters

§
options: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "initialData"> & {
initialData?: () => undefined;
}
[src]

§Return Type

§
UseQueryResult<TData, TError>
[src]
§
useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "initialData"> & {
initialData: TQueryFnData | (() => TQueryFnData);
}
): DefinedUseQueryResult<TData, TError>
[src]

§Type Parameters

§
TQueryFnData = unknown
[src]
§
TError = unknown
[src]
§
TData = TQueryFnData
[src]
§
TQueryKey extends QueryKey = QueryKey
[src]

§Parameters

§
options: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "initialData"> & {
initialData: TQueryFnData | (() => TQueryFnData);
}
[src]

§Return Type

§
useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>): UseQueryResult<TData, TError>
[src]

§Type Parameters

§
TQueryFnData = unknown
[src]
§
TError = unknown
[src]
§
TData = TQueryFnData
[src]
§
TQueryKey extends QueryKey = QueryKey
[src]

§Parameters

§
options: UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>
[src]

§Return Type

§
UseQueryResult<TData, TError>
[src]
§
useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey" | "initialData"> & {
initialData?: () => undefined;
}
): UseQueryResult<TData, TError>
[src]

§Type Parameters

§
TQueryFnData = unknown
[src]
§
TError = unknown
[src]
§
TData = TQueryFnData
[src]
§
TQueryKey extends QueryKey = QueryKey
[src]

§Parameters

§
queryKey: TQueryKey
[src]
§
options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey" | "initialData"> & {
initialData?: () => undefined;
}
optional
[src]

§Return Type

§
UseQueryResult<TData, TError>
[src]
§
useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey" | "initialData"> & {
initialData: TQueryFnData | (() => TQueryFnData);
}
): DefinedUseQueryResult<TData, TError>
[src]

§Type Parameters

§
TQueryFnData = unknown
[src]
§
TError = unknown
[src]
§
TData = TQueryFnData
[src]
§
TQueryKey extends QueryKey = QueryKey
[src]

§Parameters

§
queryKey: TQueryKey
[src]
§
options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey" | "initialData"> & {
initialData: TQueryFnData | (() => TQueryFnData);
}
optional
[src]

§Return Type

§
useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey">): UseQueryResult<TData, TError>
[src]

§Type Parameters

§
TQueryFnData = unknown
[src]
§
TError = unknown
[src]
§
TData = TQueryFnData
[src]
§
TQueryKey extends QueryKey = QueryKey
[src]

§Parameters

§
queryKey: TQueryKey
[src]
§
options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey"> optional
[src]

§Return Type

§
UseQueryResult<TData, TError>
[src]
§
useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, queryFn: QueryFunction<TQueryFnData, TQueryKey>, options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey" | "queryFn" | "initialData"> & {
initialData?: () => undefined;
}
): UseQueryResult<TData, TError>
[src]

§Type Parameters

§
TQueryFnData = unknown
[src]
§
TError = unknown
[src]
§
TData = TQueryFnData
[src]
§
TQueryKey extends QueryKey = QueryKey
[src]

§Parameters

§
queryKey: TQueryKey
[src]
§
queryFn: QueryFunction<TQueryFnData, TQueryKey>
[src]
§
options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey" | "queryFn" | "initialData"> & {
initialData?: () => undefined;
}
optional
[src]

§Return Type

§
UseQueryResult<TData, TError>
[src]
§
useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, queryFn: QueryFunction<TQueryFnData, TQueryKey>, options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey" | "queryFn" | "initialData"> & {
initialData: TQueryFnData | (() => TQueryFnData);
}
): DefinedUseQueryResult<TData, TError>
[src]

§Type Parameters

§
TQueryFnData = unknown
[src]
§
TError = unknown
[src]
§
TData = TQueryFnData
[src]
§
TQueryKey extends QueryKey = QueryKey
[src]

§Parameters

§
queryKey: TQueryKey
[src]
§
queryFn: QueryFunction<TQueryFnData, TQueryKey>
[src]
§
options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey" | "queryFn" | "initialData"> & {
initialData: TQueryFnData | (() => TQueryFnData);
}
optional
[src]

§Return Type

§
useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, queryFn: QueryFunction<TQueryFnData, TQueryKey>, options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey" | "queryFn">): UseQueryResult<TData, TError>
[src]

§Type Parameters

§
TQueryFnData = unknown
[src]
§
TError = unknown
[src]
§
TData = TQueryFnData
[src]
§
TQueryKey extends QueryKey = QueryKey
[src]

§Parameters

§
queryKey: TQueryKey
[src]
§
queryFn: QueryFunction<TQueryFnData, TQueryKey>
[src]
§
options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryKey" | "queryFn"> optional
[src]

§Return Type

§
UseQueryResult<TData, TError>
[src]