Skip to content

API Documentation / @pinia/colada / UseQueryEntryExtensions

Interface: UseQueryEntryExtensions<TData, TError, TDataInitial>

Allows defining extensions to the query entry that are returned by useQuery().

Type Parameters

TData

TData

TError

TError

TDataInitial

TDataInitial extends TData | undefined = undefined

Properties

dataUpdatedAt

ts
dataUpdatedAt: ShallowRef<number>;

Timestamp of when data was last successfully fetched. TanStack Query compatible property.


errorUpdatedAt

ts
errorUpdatedAt: ShallowRef<number>;

Timestamp of when an error last occurred. TanStack Query compatible property.


fetchStatus

ts
fetchStatus: ComputedRef<FetchStatus>;

TanStack Query compatible fetch status. Maps to: 'fetching' when loading, 'idle' otherwise. Note: 'paused' is not currently supported.


isDelaying

ts
isDelaying: ShallowRef<boolean>;

Returns whether the query is currently delaying its asyncStatus from becoming 'loading'. Requires the PiniaColadaDelay plugin.


isError

ts
isError: ComputedRef<boolean>;

Whether the query status is 'error'. TanStack Query compatible property.


isFetched

ts
isFetched: ShallowRef<boolean>;

Whether the query has fetched at least once. TanStack Query compatible property.


isFetchedAfterMount

ts
isFetchedAfterMount: ShallowRef<boolean>;

Whether the query has fetched after component mount. TanStack Query compatible property.


isFetching

ts
isFetching: ComputedRef<boolean>;

Whether the query is currently fetching (asyncStatus === 'loading'). TanStack Query compatible property.


isLoadingError

ts
isLoadingError: ComputedRef<boolean>;

Whether the query errored on initial load (never had data). TanStack Query compatible property.


isRefetchError

ts
isRefetchError: ComputedRef<boolean>;

Whether the query errored on refetch (had data before). TanStack Query compatible property.


isRefetching

ts
isRefetching: ComputedRef<boolean>;

Whether the query is refetching (fetching but not initial load). TanStack Query compatible property.


isRetrying

ts
isRetrying: ShallowRef<boolean>;

Whether the query is currently retrying. Requires the @pinia/colada-plugin-retry plugin.


isStale

ts
isStale: ComputedRef<boolean>;

Whether the query data is stale. TanStack Query compatible property.


isSuccess

ts
isSuccess: ComputedRef<boolean>;

Whether the query status is 'success'. TanStack Query compatible property.


retry?

ts
optional retry: object;

Plain object with retry state for devtools. Only present in development mode.

isRetrying

ts
isRetrying: boolean;

retryCount

ts
retryCount: number;

retryError

ts
retryError: unknown;

retryCount

ts
retryCount: ShallowRef<number>;

The number of retries that have been scheduled so far. Resets on success or manual refetch. Requires the @pinia/colada-plugin-retry plugin.


retryError

ts
retryError: ShallowRef<TError | null>;

The error that triggered the current retry. null when not retrying or when retries are exhausted. Requires the @pinia/colada-plugin-retry plugin.

Released under the MIT License.