0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
query/docs/framework/svelte/reference/interfaces/QueryCacheConfig.md
Wonsuk Choi e57f8163b1
docs(query-core): add JSDoc across the package and expose it in generated reference docs (#11438)
* docs(query-core): add JSDoc across the package and expose it in generated reference docs

* docs(config.json): add sidebar entries for newly generated query-core reference docs

* docs(query-core): migrate remaining prose from the legacy 'docs/reference' pages into JSDoc

* docs(query-core): remove legacy 'docs/reference' pages superseded by the generated reference

* docs(query-core): regenerate reference docs after merging main

* docs(query-core): document missing default values for MutationOptions, combine, and QueryFilters.type

* fix(query-devtools): drop unnecessary 'query-core' project reference

* docs(query-core): document missing default values and normalize 'Defaults to' spacing

* docs(query-core): fix 'environmentManager' JSDoc example
2026-09-07 18:22:38 +02:00

1.8 KiB

id title
QueryCacheConfig QueryCacheConfig

Defined in: packages/query-core/src/queryCache.ts:25

Global callbacks that fire for every query handled by a QueryCache, regardless of which component or observer triggered it. Unlike QueryClient's defaultOptions, which a query can override, these callbacks are always called. Unlike MutationCacheConfig's callbacks, these are fire-and-forget: their return value is not awaited before the query settles.

Properties

onError()?

optional onError: (error, query) => void;

Defined in: packages/query-core/src/queryCache.ts:27

Called when any query in the cache encounters an error.

Parameters

error

Error

query

Query<unknown, unknown, unknown>

Returns

void


onSettled()?

optional onSettled: (data, error, query) => void;

Defined in: packages/query-core/src/queryCache.ts:34

Called when any query in the cache is settled, either successfully or with an error.

Parameters

data

unknown

error

Error | null

query

Query<unknown, unknown, unknown>

Returns

void


onSuccess()?

optional onSuccess: (data, query) => void;

Defined in: packages/query-core/src/queryCache.ts:32

Called when any query in the cache is successful.

Parameters

data

unknown

query

Query<unknown, unknown, unknown>

Returns

void