Interface IQueryClient
- Namespace
- Fetchling.Core
- Assembly
- Fetchling.Core.dll
The central client for creating and managing queries and mutations. Acts as the cache owner — all queries and mutations created through it share the same cache.
public interface IQueryClient : IDisposable
- Inherited Members
- Extension Methods
Methods
CreateInfiniteQuery<TArgs, TData, TPageParam>(InfiniteQueryOptions<TArgs, TData, TPageParam>)
Gets or creates an infinite (paginated) query. Queries with the same key share one cache entry. Use FetchNextPage() and FetchPreviousPage() to accumulate pages.
IInfiniteQuery<TArgs, TData, TPageParam> CreateInfiniteQuery<TArgs, TData, TPageParam>(InfiniteQueryOptions<TArgs, TData, TPageParam> options) where TData : class
Parameters
optionsInfiniteQueryOptions<TArgs, TData, TPageParam>
Returns
- IInfiniteQuery<TArgs, TData, TPageParam>
Type Parameters
TArgsTDataTPageParam
CreateMutation<TArgs, TData>(MutationOptions<TArgs, TData>)
Creates a mutation. If InvalidateKeys is set, the specified keys are invalidated automatically on success.
IMutation<TArgs, TData> CreateMutation<TArgs, TData>(MutationOptions<TArgs, TData> options)
Parameters
optionsMutationOptions<TArgs, TData>
Returns
- IMutation<TArgs, TData>
Type Parameters
TArgsTData
CreateMutation<TArgs, TData, TProgress>(MutationOptions<TArgs, TData, TProgress>)
Creates a mutation whose mutator reports progress through an IProgress<T>; the latest value travels on State as Progress. If InvalidateKeys is set, the specified keys are invalidated automatically on success.
IMutation<TArgs, TData, TProgress> CreateMutation<TArgs, TData, TProgress>(MutationOptions<TArgs, TData, TProgress> options)
Parameters
optionsMutationOptions<TArgs, TData, TProgress>
Returns
- IMutation<TArgs, TData, TProgress>
Type Parameters
TArgsTDataTProgress
CreateQuery<TArgs, TData>(QueryOptions<TArgs, TData>)
Gets or creates a query that accepts parameters for the given key. If a query with the same key already exists in the cache, it is returned as-is.
IQuery<TArgs, TData> CreateQuery<TArgs, TData>(QueryOptions<TArgs, TData> options) where TData : class
Parameters
optionsQueryOptions<TArgs, TData>
Returns
- IQuery<TArgs, TData>
Type Parameters
TArgsTData
CreateStreamedQuery<TArgs, TData, TChunk>(StreamedQueryOptions<TArgs, TData, TChunk>)
Gets or creates a streamed query: its fetcher yields chunks, which are folded into the data as they arrive, so the data can be rendered while it grows. Queries with the same key share one cache entry and one running stream. The result is a regular IQuery<TArgs, TData>; see StreamedQueryOptions<TArgs, TData, TChunk> for how streaming shows up in its state.
IQuery<TArgs, TData> CreateStreamedQuery<TArgs, TData, TChunk>(StreamedQueryOptions<TArgs, TData, TChunk> options) where TData : class
Parameters
optionsStreamedQueryOptions<TArgs, TData, TChunk>
Returns
- IQuery<TArgs, TData>
Type Parameters
TArgsTDataTChunk
Invalidate(QueryKey)
Marks all queries matching the given key as stale and, for entries with an active
subscriber, triggers a re-fetch. Entries still within their StaleTime window are
left untouched, and entries with no active subscriber are only marked stale — the re-fetch
is deferred until the next subscriber arrives.
void Invalidate(QueryKey key)
Parameters
keyQueryKey
Invalidate(Func<QueryKey, bool>)
Marks all queries whose key matches the predicate as stale and, for entries with an active
subscriber, triggers a re-fetch. Entries still within their StaleTime window are
left untouched, and entries with no active subscriber are only marked stale — the re-fetch
is deferred until the next subscriber arrives.
void Invalidate(Func<QueryKey, bool> predicate)