Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FetchResourceOptions<ResourceData, TError>

Type Parameters

  • ResourceData = unknown

  • TError = unknown

Hierarchy

  • FetchOptions<ResourceData, TError>
    • FetchResourceOptions

Index

Properties

_defaulted?: boolean
behavior?: QueryBehavior<ResourceData, TError, ResourceData, QueryKey>
cacheTime?: number
getNextPageParam?: GetNextPageParamFunction<ResourceData>

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<ResourceData>

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?: ResourceData | InitialDataFunction<ResourceData>
initialDataUpdatedAt?: number | (() => undefined | number)
key: string
meta?: QueryMeta

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

queryFn?: QueryFunction<ResourceData, QueryKey>
queryHash?: string
queryKey?: QueryKey
queryKeyHashFn?: QueryKeyHashFunction<QueryKey>
requestConfig?: RequestConfig
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

Set this to false to disable structural sharing between query results. Defaults to true.

Methods

  • isDataEqual(oldData: undefined | TData, newData: TData): boolean
  • Parameters

    • oldData: undefined | TData
    • newData: TData

    Returns boolean

Generated using TypeDoc