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

IncludeQueryKeyInMetrics

When true, metrics are additionally tagged with the full QueryKey string (e.g. "users:42") alongside the low-cardinality query.name tag. Defaults to false: query keys commonly include per-entity arguments, and tagging metrics with them produces one time series per distinct argument value, which exceeds the cardinality limits most metrics backends enforce. Traces and log messages always carry the full key regardless of this setting. Only enable this when your QueryKey values are drawn from a bounded set.

public bool IncludeQueryKeyInMetrics { get; set; }

Property Value

bool

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()