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.
optional onError: (error, query) => void;Defined in: packages/query-core/src/queryCache.ts:27
Called when any query in the cache encounters an error.
Error
Query<unknown, unknown, unknown>
void
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.
unknown
Error | null
Query<unknown, unknown, unknown>
void
optional onSuccess: (data, query) => void;Defined in: packages/query-core/src/queryCache.ts:32
Called when any query in the cache is successful.
unknown
Query<unknown, unknown, unknown>
void