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

QueryOptions

interface QueryOptions <TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> {
_defaulted?: boolean;
behavior?: QueryBehavior<TQueryFnData, TError, TData>;
cacheTime?: number;
getNextPageParam?: GetNextPageParamFunction<TQueryFnData>;
getPreviousPageParam?: GetPreviousPageParamFunction<TQueryFnData>;
initialData?: TData | InitialDataFunction<TData>;
initialDataUpdatedAt?: number | (() => number | undefined);
isDataEqual?: (oldData: TData | undefined, newData: TData) => boolean;
meta?: QueryMeta;
networkMode?: NetworkMode;
queryFn?: QueryFunction<TQueryFnData, TQueryKey>;
queryHash?: string;
queryKey?: TQueryKey;
queryKeyHashFn?: QueryKeyHashFunction<TQueryKey>;
retry?: RetryValue<TError>;
retryDelay?: RetryDelayValue<TError>;
structuralSharing?: boolean | ((oldData: TData | undefined, newData: TData) => TData);
}

§Type Parameters

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

§Properties

§
_defaulted?: boolean
[src]
§
behavior?: QueryBehavior<TQueryFnData, TError, TData>
[src]
§
cacheTime?: number
[src]
§
getNextPageParam?: GetNextPageParamFunction<TQueryFnData>
[src]

This function can be set to automatically get the next cursor for infinite queries. The result will also be used to determine the value of hasNextPage.

§
getPreviousPageParam?: GetPreviousPageParamFunction<TQueryFnData>
[src]

This function can be set to automatically get the previous cursor for infinite queries. The result will also be used to determine the value of hasPreviousPage.

§
initialData?: TData | InitialDataFunction<TData>
[src]
§
initialDataUpdatedAt?: number | (() => number | undefined)
[src]
§
isDataEqual?: (oldData: TData | undefined, newData: TData) => boolean
[src]
§

Additional payload to be stored on each query. Use this property to pass information that can be used in other places.

§
networkMode?: NetworkMode
[src]
§
queryFn?: QueryFunction<TQueryFnData, TQueryKey>
[src]
§
queryHash?: string
[src]
§
queryKey?: TQueryKey
[src]
§
queryKeyHashFn?: QueryKeyHashFunction<TQueryKey>
[src]
§
retry?: RetryValue<TError>
[src]

If false, failed queries will not retry by default. If true, failed queries will retry infinitely., failureCount: num If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function (failureCount, error) => boolean failed queries will retry until the function returns false.

§
retryDelay?: RetryDelayValue<TError>
[src]
§
structuralSharing?: boolean | ((oldData: TData | undefined, newData: TData) => TData)
[src]

Set this to false to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. Defaults to true.