Interface FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>

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

Type Parameters

  • TQueryFnData = unknown

  • TError = unknown

  • TData = TQueryFnData

  • TQueryKey extends QueryKey = QueryKey

Hierarchy

Properties

_defaulted?: boolean
behavior?: QueryBehavior<TQueryFnData, TError, InfiniteData<TData>, QueryKey>
cacheTime?: number
getNextPageParam?: GetNextPageParamFunction<TQueryFnData>

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>

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?: InfiniteData<TData> | InitialDataFunction<InfiniteData<TData>>
initialDataUpdatedAt?: number | (() => undefined | number)

Type declaration

    • (): undefined | number
    • Returns undefined | number

isDataEqual?: ((oldData, newData) => boolean)

Type declaration

    • (oldData, newData): boolean
    • Parameters

      Returns boolean

      Deprecated

      This callback will be removed in the next major version. You can achieve the same functionality by passing a function to structuralSharing instead.

meta?: QueryMeta

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

networkMode?: NetworkMode
queryFn?: QueryFunction<TQueryFnData, TQueryKey, any>
queryHash?: string
queryKey?: TQueryKey
queryKeyHashFn?: QueryKeyHashFunction<TQueryKey>
retry?: RetryValue<TError>

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>
staleTime?: number

The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache.

structuralSharing?: boolean | ((oldData, newData) => InfiniteData<TData>)

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.

Type declaration

Generated using TypeDoc