Skip to main content
QueryClient manages cache reads, writes, invalidations, and subscriptions. It is exposed as kweri.queryClient for advanced use cases — in most applications you’ll interact with the Kweri facade instead.

Constructor

Methods

getQueryKey

Returns the serialized cache key for an endpoint + params pair.

invalidateQuery

Marks the entry for endpoint + params as stale by setting updatedAt = 0.

invalidateByKey

Invalidates by raw cache key string.

invalidateByPath

Invalidates all entries whose key contains/matches pattern.

removeQuery

Deletes the cache entry.

removeByKey

Deletes by raw key string.

getCachedData

Returns cached data or undefined.

setCachedData

Writes data into the cache and notifies observers.

subscribe

Subscribes to cache changes for a specific query.

CacheStore

The underlying storage used by QueryClient. Exposed as kweri.queryClient → internal store.

ObserverRegistry

Pub/sub registry for cache entry notifications.