mirror of
https://github.com/TanStack/query.git
synced 2026-11-18 19:33:22 +00:00
* fix(types): propagate generic type params to useMutationState select callback When TResult is a typed MutationState, the select callback parameter now receives the correctly typed Mutation instead of the base Mutation type. Adds a second type param TMutation (defaulting to MutationTypeFromResult<TResult>) to MutationStateOptions across all five framework adapters. Uses a non-distributive conditional type to avoid union expansion when TResult is unresolved. Fixes #9825 * ci: apply automated fixes * refactor(types): simplify useMutationState cast to mutation as TMutation Replace the double-cast `(fn as unknown as (m: Mutation) => TResult)(m)` with the direct `fn(m as TMutation)` across all five framework packages. The constraint `TMutation extends Mutation<any, any, any, any>` creates sufficient overlap for the single cast to compile cleanly on TS 5.4–6.0. * fix(test): reorder imports in useMutationState.test-d.tsx per import/order rule Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(svelte-query): eliminate duplicate MutationTypeFromResult definition Export MutationTypeFromResult from types.ts so useMutationState.svelte.ts can import it instead of redefining it. Also normalises the else branch to plain Mutation, matching every other adapter. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc> |
History
|
|
|---|---|---|
| .. | ||
| src | ||
| CHANGELOG.md | ||
| eslint.config.js | ||
| package.json | ||
| README.md | ||
| root.eslint.config.js | ||
| test-setup.ts | ||
| tsconfig.json | ||
| tsconfig.legacy.json | ||
| tsconfig.prod.json | ||
| tsup.config.ts | ||
| vite.config.ts | ||
Hooks for fetching, caching and updating asynchronous data in Solid
Enjoy this library? Try the entire TanStack! TanStack Table, TanStack Router, TanStack Virtual
Visit tanstack.com/query for docs, guides, API and more!
Quick Features
- Transport/protocol/backend agnostic data fetching (REST, GraphQL, promises, whatever!)
- Auto Caching + Refetching (stale-while-revalidate, Window Refocus, Polling/Realtime)
- Parallel + Dependent Queries
- Mutations + Reactive Query Refetching
- Multi-layer Cache + Automatic Garbage Collection
- Paginated + Cursor-based Queries
- Load-More + Infinite Scroll Queries w/ Scroll Recovery
- Request Cancellation
- Suspense + Fetch-As-You-Render Query Prefetching
- Dedicated Devtools