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

QueryClient

class QueryClient {
constructor(config?: QueryClientConfig);
private defaultOptions;
private logger;
private mutationCache;
private mutationDefaults;
private queryCache;
private queryDefaults;
private unsubscribeFocus?;
private unsubscribeOnline?;
 
cancelQueries(filters?: QueryFilters, options?: CancelOptions): Promise<void>;
cancelQueries(
queryKey?: QueryKey,
filters?: QueryFilters,
options?: CancelOptions,
): Promise<void>;
clear(): void;
defaultMutationOptions<T extends MutationOptions<any, any, any, any>>(options?: T): T;
defaultQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey>(options?: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey> | DefaultedQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): DefaultedQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>;
fetchInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<InfiniteData<TData>>;
fetchInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<InfiniteData<TData>>;
fetchInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(
queryKey: TQueryKey,
queryFn: QueryFunction<TQueryFnData, TQueryKey>,
options?: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
): Promise<InfiniteData<TData>>;
fetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<TData>;
fetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<TData>;
fetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(
queryKey: TQueryKey,
queryFn: QueryFunction<TQueryFnData, TQueryKey>,
options?: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
): Promise<TData>;
getDefaultOptions(): DefaultOptions;
getLogger(): Logger;
getMutationCache(): MutationCache;
getMutationDefaults(mutationKey?: MutationKey): MutationObserverOptions<any, any, any, any> | undefined;
getQueriesData<TQueryFnData = unknown>(queryKey: QueryKey): [QueryKey, TQueryFnData | undefined][];
getQueriesData<TQueryFnData = unknown>(filters: QueryFilters): [QueryKey, TQueryFnData | undefined][];
getQueryCache(): QueryCache;
getQueryData<TQueryFnData = unknown>(queryKey: QueryKey, filters?: QueryFilters): TQueryFnData | undefined;
getQueryDefaults(queryKey?: QueryKey): QueryObserverOptions<any, any, any, any, any> | undefined;
getQueryState<TQueryFnData = unknown, TError = undefined>(queryKey: QueryKey, filters?: QueryFilters): QueryState<TQueryFnData, TError> | undefined;
invalidateQueries<TPageData = unknown>(filters?: InvalidateQueryFilters<TPageData>, options?: InvalidateOptions): Promise<void>;
invalidateQueries<TPageData = unknown>(
queryKey?: QueryKey,
filters?: InvalidateQueryFilters<TPageData>,
): Promise<void>;
isFetching(filters?: QueryFilters): number;
isFetching(queryKey?: QueryKey, filters?: QueryFilters): number;
isMutating(filters?: MutationFilters): number;
mount(): void;
prefetchInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<void>;
prefetchInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<void>;
prefetchInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(
queryKey: TQueryKey,
queryFn: QueryFunction<TQueryFnData, TQueryKey>,
options?: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
): Promise<void>;
prefetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<void>;
prefetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<void>;
prefetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(
queryKey: TQueryKey,
queryFn: QueryFunction<TQueryFnData, TQueryKey>,
options?: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
): Promise<void>;
refetchQueries<TPageData = unknown>(filters?: RefetchQueryFilters<TPageData>, options?: RefetchOptions): Promise<void>;
refetchQueries<TPageData = unknown>(
queryKey?: QueryKey,
filters?: RefetchQueryFilters<TPageData>,
options?: RefetchOptions,
): Promise<void>;
removeQueries(filters?: QueryFilters): void;
removeQueries(queryKey?: QueryKey, filters?: QueryFilters): void;
resetQueries<TPageData = unknown>(filters?: ResetQueryFilters<TPageData>, options?: ResetOptions): Promise<void>;
resetQueries<TPageData = unknown>(
queryKey?: QueryKey,
filters?: ResetQueryFilters<TPageData>,
options?: ResetOptions,
): Promise<void>;
resumePausedMutations(): Promise<void>;
setDefaultOptions(options: DefaultOptions): void;
setMutationDefaults(mutationKey: MutationKey, options: MutationObserverOptions<any, any, any, any>): void;
setQueriesData<TQueryFnData>(
queryKey: QueryKey,
updater: Updater<TQueryFnData | undefined, TQueryFnData | undefined>,
options?: SetDataOptions,
): [QueryKey, TQueryFnData | undefined][];
setQueriesData<TQueryFnData>(
filters: QueryFilters,
updater: Updater<TQueryFnData | undefined, TQueryFnData | undefined>,
options?: SetDataOptions,
): [QueryKey, TQueryFnData | undefined][];
setQueryData<TQueryFnData>(
queryKey: QueryKey,
updater: Updater<TQueryFnData | undefined, TQueryFnData | undefined>,
options?: SetDataOptions,
): TQueryFnData | undefined;
setQueryDefaults(queryKey: QueryKey, options: QueryObserverOptions<unknown, any, any, any>): void;
unmount(): void;
}

§Constructors

§
new QueryClient(config?: QueryClientConfig)
[src]

§Properties

§
defaultOptions
[src]
§
logger
[src]
§
mutationCache
[src]
§
mutationDefaults
[src]
§
queryCache
[src]
§
queryDefaults
[src]
§
unsubscribeFocus
[src]
§
unsubscribeOnline
[src]

§Methods

§
cancelQueries(filters?: QueryFilters, options?: CancelOptions): Promise<void>
[src]
cancelQueries(queryKey?: QueryKey, filters?: QueryFilters, options?: CancelOptions): Promise<void>
[src]
§
clear(): void
[src]
§
defaultMutationOptions<T extends MutationOptions<any, any, any, any>>(options?: T): T
[src]
§
defaultQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey>(options?: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey> | DefaultedQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): DefaultedQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>
[src]
§
fetchInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<InfiniteData<TData>>
[src]
fetchInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<InfiniteData<TData>>
[src]
fetchInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, queryFn: QueryFunction<TQueryFnData, TQueryKey>, options?: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<InfiniteData<TData>>
[src]
§
fetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<TData>
[src]
fetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<TData>
[src]
fetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, queryFn: QueryFunction<TQueryFnData, TQueryKey>, options?: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<TData>
[src]
§
getDefaultOptions(): DefaultOptions
[src]
§
getLogger(): Logger
[src]
§
getMutationCache(): MutationCache
[src]
§
getMutationDefaults(mutationKey?: MutationKey): MutationObserverOptions<any, any, any, any> | undefined
[src]
§
getQueriesData<TQueryFnData = unknown>(queryKey: QueryKey): [QueryKey, TQueryFnData | undefined][]
[src]
getQueriesData<TQueryFnData = unknown>(filters: QueryFilters): [QueryKey, TQueryFnData | undefined][]
[src]
§
getQueryCache(): QueryCache
[src]
§
getQueryData<TQueryFnData = unknown>(queryKey: QueryKey, filters?: QueryFilters): TQueryFnData | undefined
[src]
§
getQueryDefaults(queryKey?: QueryKey): QueryObserverOptions<any, any, any, any, any> | undefined
[src]
§
getQueryState<TQueryFnData = unknown, TError = undefined>(queryKey: QueryKey, filters?: QueryFilters): QueryState<TQueryFnData, TError> | undefined
[src]
§
invalidateQueries<TPageData = unknown>(filters?: InvalidateQueryFilters<TPageData>, options?: InvalidateOptions): Promise<void>
[src]
invalidateQueries<TPageData = unknown>(queryKey?: QueryKey, filters?: InvalidateQueryFilters<TPageData>, options?: InvalidateOptions): Promise<void>
[src]
§
isFetching(filters?: QueryFilters): number
[src]
isFetching(queryKey?: QueryKey, filters?: QueryFilters): number
[src]
§
isMutating(filters?: MutationFilters): number
[src]
§
mount(): void
[src]
§
prefetchInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<void>
[src]
prefetchInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<void>
[src]
prefetchInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, queryFn: QueryFunction<TQueryFnData, TQueryKey>, options?: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<void>
[src]
§
prefetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<void>
[src]
prefetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<void>
[src]
prefetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, queryFn: QueryFunction<TQueryFnData, TQueryKey>, options?: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>): Promise<void>
[src]
§
refetchQueries<TPageData = unknown>(filters?: RefetchQueryFilters<TPageData>, options?: RefetchOptions): Promise<void>
[src]
refetchQueries<TPageData = unknown>(queryKey?: QueryKey, filters?: RefetchQueryFilters<TPageData>, options?: RefetchOptions): Promise<void>
[src]
§
removeQueries(filters?: QueryFilters): void
[src]
removeQueries(queryKey?: QueryKey, filters?: QueryFilters): void
[src]
§
resetQueries<TPageData = unknown>(filters?: ResetQueryFilters<TPageData>, options?: ResetOptions): Promise<void>
[src]
resetQueries<TPageData = unknown>(queryKey?: QueryKey, filters?: ResetQueryFilters<TPageData>, options?: ResetOptions): Promise<void>
[src]
§
resumePausedMutations(): Promise<void>
[src]
§
setDefaultOptions(options: DefaultOptions): void
[src]
§
setMutationDefaults(mutationKey: MutationKey, options: MutationObserverOptions<any, any, any, any>): void
[src]
§
setQueriesData<TQueryFnData>(queryKey: QueryKey, updater: Updater<TQueryFnData | undefined, TQueryFnData | undefined>, options?: SetDataOptions): [QueryKey, TQueryFnData | undefined][]
[src]
setQueriesData<TQueryFnData>(filters: QueryFilters, updater: Updater<TQueryFnData | undefined, TQueryFnData | undefined>, options?: SetDataOptions): [QueryKey, TQueryFnData | undefined][]
[src]
§
setQueryData<TQueryFnData>(queryKey: QueryKey, updater: Updater<TQueryFnData | undefined, TQueryFnData | undefined>, options?: SetDataOptions): TQueryFnData | undefined
[src]
§
setQueryDefaults(queryKey: QueryKey, options: QueryObserverOptions<unknown, any, any, any>): void
[src]
§
unmount(): void
[src]