Context

interface Context<T>

Context for query command.

Parameters

T

Type of the return value from the query.

Properties

Link copied to clipboard
abstract val dispatch: QueryDispatch<T>
Link copied to clipboard
abstract val options: QueryOptions
Link copied to clipboard
abstract val receiver: QueryReceiver
Link copied to clipboard
abstract val relay: QueryErrorRelay?
Link copied to clipboard
abstract val state: QueryModel<T>

Functions

Link copied to clipboard
inline suspend fun <T, S> QueryCommand.Context<QueryChunks<T, S>>.dispatchFetchChunksResult(key: InfiniteQueryKey<T, S>, variable: S, marker: Marker, noinline callback: QueryCallback<QueryChunks<T, S>>?)

Dispatches the result of fetching data for the InfiniteQueryKey.

Link copied to clipboard

Dispatches the fetch failure.

Link copied to clipboard
inline suspend fun <T> QueryCommand.Context<T>.dispatchFetchResult(key: QueryKey<T>, marker: Marker, noinline callback: QueryCallback<T>?)

Dispatches the fetch result.

Link copied to clipboard

Dispatches the fetch success.

Link copied to clipboard
inline suspend fun <T, S> QueryCommand.Context<QueryChunks<T, S>>.dispatchRevalidateChunksResult(key: InfiniteQueryKey<T, S>, chunks: QueryChunks<T, S>, marker: Marker, noinline callback: QueryCallback<QueryChunks<T, S>>?)

Dispatches the result of revalidating data for the InfiniteQueryKey.

Link copied to clipboard
suspend fun <T> QueryCommand.Context<T>.fetch(key: QueryKey<T>, retryFn: RetryFn<T> = options.exponentialBackOff(onRetry = onRetryCallback(key.id))): Result<T>

Fetches the data.

suspend fun <T, S> QueryCommand.Context<QueryChunks<T, S>>.fetch(key: InfiniteQueryKey<T, S>, variable: S, retryFn: RetryFn<T> = options.exponentialBackOff(onRetry = onRetryCallback(key.id))): Result<T>

Fetches data for the InfiniteQueryKey using the value of variable.

Link copied to clipboard

Reports the query error.

Link copied to clipboard

Revalidates the data for the InfiniteQueryKey using the value of chunks.

Link copied to clipboard
fun <T> QueryCommand.Context<T>.shouldFetch(revision: String? = null): Boolean

Determines whether a fetch operation is necessary based on the current state.

Link copied to clipboard

Determines whether query processing needs to be paused based on error.