Browse documentation

QueryConfig

Type. Query key, fetcher and freshness options.

Table of contents

Category

Type

Type import

ts
import type { QueryConfig } from "valyrian.js/query";

Public signature

ts
type QueryConfig<TData> = { key: QueryKey; fetcher: () => Promise<TData> | TData; staleTime?: number; };

Type usage

QueryConfig binds a key to a typed fetcher and an optional per-query stale interval.

Defaults

staleTime inherits the QueryClient staleTime when omitted.