# Extension points — TanStack/query

> Canonical page: https://codevetter.com/unpack/query/extension-points

# Extension points — TanStack/query

Scanned commit 29859ae60c8dca0a5cdbf8abccc775b655cf43e2 (2026-10-02). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Extensions attach through options, callbacks, subscriptions, adapter primitives, and separate packages. Query and mutation functions are the main transport boundary, while persister contracts provide storage substitution. Manager setters allow environments and frameworks to replace event or scheduling behavior. Typed registration and ESLint rule tables supply compile-time and tooling extension mechanisms.
- Applications supply queryFn and mutationFn; query persisters wrap fetch execution, and QueryBehavior.onFetch can customize fetch context, with infinite queries selecting their built-in behavior. — [packages/query-core/src/query.ts#L649-L712](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-core/src/query.ts#L649-L712) [packages/query-core/src/mutation.ts#L295-L314](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-core/src/mutation.ts#L295-L314)
- setQueryDefaults and setMutationDefaults register options by hashed keys; matching query defaults merge in registration order, so specific defaults should follow generic ones. — [packages/query-core/src/queryClient.ts#L856-L888](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-core/src/queryClient.ts#L856-L888) [packages/query-core/src/queryClient.ts#L901-L916](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-core/src/queryClient.ts#L901-L916) [packages/query-core/src/queryClient.ts#L930-L945](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-core/src/queryClient.ts#L930-L945)
- Persister requires persistClient, restoreClient, and removeClient; the async storage factory accepts caller storage, key, throttle interval, serializers, and a retry callback that can transform or discard the snapshot. — [packages/query-persist-client-core/src/persist.ts#L12-L22](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-persist-client-core/src/persist.ts#L12-L22) [packages/query-async-storage-persister/src/index.ts#L17-L39](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-async-storage-persister/src/index.ts#L17-L39) [packages/query-async-storage-persister/src/index.ts#L63-L82](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-async-storage-persister/src/index.ts#L63-L82)
- Dehydration supports query/mutation selection, data serialization, and pending-error redaction; hydration accepts deserialization and restored query/mutation defaults. — [packages/query-core/src/hydration.ts#L42-L70](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-core/src/hydration.ts#L42-L70)
- focusManager.setEventListener and onlineManager.setEventListener replace environment listeners and clean up prior handlers; callers can also set focus or online state manually. — [packages/query-core/src/focusManager.ts#L77-L112](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-core/src/focusManager.ts#L77-L112) [packages/query-core/src/onlineManager.ts#L75-L103](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-core/src/onlineManager.ts#L75-L103)
- createNotifyManager exposes setNotifyFunction, setBatchNotifyFunction, and setScheduler to integrate test wrappers, framework batching, and alternate scheduling. — [packages/query-core/src/notifyManager.ts#L92-L135](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-core/src/notifyManager.ts#L92-L135)
- The Register interface supports declaration merging for defaultError, queryKey, mutationKey, queryMeta, and mutationMeta through core or adapter modules. — [packages/query-core/src/types.ts#L35-L85](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/query-core/src/types.ts#L35-L85)
- Framework APIs build on shared observers, with Lit exporting query/mutation controllers and Angular exporting injection/provider features; lint extensions register rule modules in rules.ts and configure presets in index.ts. — [packages/lit-query/src/index.ts#L18-L41](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/lit-query/src/index.ts#L18-L41) [packages/angular-query-experimental/src/index.ts#L25-L60](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/angular-query-experimental/src/index.ts#L25-L60) [packages/eslint-plugin-query/src/rules.ts#L20-L29](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/eslint-plugin-query/src/rules.ts#L20-L29) [packages/eslint-plugin-query/src/index.ts#L17-L30](https://github.com/TanStack/query/blob/29859ae60c8dca0a5cdbf8abccc775b655cf43e2/packages/eslint-plugin-query/src/index.ts#L17-L30)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
