Constructor
KweriOptions
| Property | Type | Default | Description |
|---|---|---|---|
baseURL | string | — | Required. Base URL prepended to all request paths |
fetcher | Fetcher | global fetch | Custom HTTP transport |
staleTime | number | 0 | Milliseconds data is considered fresh |
cacheTime | number | 300_000 | Milliseconds to retain stale data with no observers |
maxRetries | number | 0 | Max automatic retries for retryable errors |
gcInterval | number | undefined | Milliseconds between GC sweeps (disabled if omitted) |
persistence | PersistenceAdapter | undefined | Adapter for cross-session cache persistence |
enableDevTools | boolean | false | Mount the DevTools overlay (no-op in production) |
devtools | MountKweriDevToolsOptions | {} | DevTools panel options |
Methods
query
mutate
getCachedData
undefined if not cached.
setCachedData
success with updatedAt = Date.now().
invalidateQuery
invalidateByPath
pattern as stale.
invalidateQueryByKey
removeQuery
removeQueryByKey
subscribe
onCacheChange
isInFlight
true if a fetch is currently in progress for this query.
getQueryKey
GET:/users:{}).