Table of Contents

Class QueryClientOptions

Namespace
DotNetQuery.Core
Assembly
DotNetQuery.Core.dll

Global configuration options applied to all queries and mutations created by an IQueryClient. Individual QueryOptions<TArgs, TData> and MutationOptions<TArgs, TData> can override most settings.

public sealed record QueryClientOptions : IEquatable<QueryClientOptions>
Inheritance
QueryClientOptions
Implements
Inherited Members

Properties

CacheTime

The duration for which data is kept in the cache after all subscribers have disposed. Defaults to 5 minutes.

public TimeSpan CacheTime { get; set; }

Property Value

TimeSpan

ExecutionMode

Determines how the IQueryClient is registered in the DI container. Defaults to Csr.

public QueryExecutionMode ExecutionMode { get; set; }

Property Value

QueryExecutionMode

RefetchInterval

When set, queries automatically re-fetch at this interval while they have active subscribers. null disables automatic re-fetching. Must be a positive duration when set.

public TimeSpan? RefetchInterval { get; set; }

Property Value

TimeSpan?

RetryHandler

The retry handler used for all queries and mutations unless overridden per-query or per-mutation. Defaults to DotNetQuery.Core.Internals.DefaultRetryHandler.

public IRetryHandler RetryHandler { get; set; }

Property Value

IRetryHandler

StaleTime

The duration after which fetched data is considered stale and eligible for re-fetching. Defaults to Zero, meaning data is stale immediately after being fetched.

public TimeSpan StaleTime { get; set; }

Property Value

TimeSpan

Methods

Validate()

Validates all option values, throwing ArgumentOutOfRangeException or ArgumentNullException with a descriptive message for any invalid value. Called automatically by QueryClientFactory and the DI extension.

public void Validate()