* test(preact-query/useInfiniteQuery): add tests for 'initialData' with a failed refetch and 'skipToken' dependent query
* test(react-query/useInfiniteQuery): add tests for 'initialData' with a failed refetch and 'skipToken' dependent query
* docs(vue-query,solid-query): inline react reference content instead of 'ref'-ing hand-written react docs
* docs(react-query): generate reference docs with TypeDoc
* docs(vue-query,solid-query): fix dangling suspense-hook links left over from the react content copy
* docs(solid-query): apply solid's callback call form to inlined reference examples
* docs(react-query): correct inaccurate JSDoc statements flagged in review
* docs(vue-query,solid-query): fix reactivity-aware examples and inaccurate type signatures flagged in review
* docs(vue-query,solid-query): fix remaining type/behavior inaccuracies flagged in second review
* docs(react-query): stop implying a default queryFn defers a fetch the way 'enabled: false' does
* docs(vue-query): mark 'mutate'/'mutateAsync' per-call options as optional
* docs(react-query): port JSDoc '@example's from preact-query
* docs(react-query): backport 'useQueries' memoization/select-typing caveats and 'queryOptions' TkDodo link from hand-written docs
* docs(react-query): correct inaccurate JSDoc statements flagged in review
* chore: use infiniteQuery instead of fetchInfiniteQuery et al
* ci: apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* test(react-query): cover falsy errors with throwOnError in useQuery
* test(react-query): show falsy errors silently skip the error boundary
* fix(react-query): throw falsy errors from useQueries to the error boundary
* chore: add changeset
* chore: tsup -> tsdown
* revert size-limit and fix the build instead
* fix angular and devtools build
* fix nextJs builds
* more solid related things
* fix: import order
* 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>
* fix(query-core): resolve suspense when query data is set programmatically
When useSuspenseQuery is used and setQueryData populates the cache
while a fetch is in-flight, the suspense boundary stays stuck on the
original fetch promise. This prevents streamedQuery and manual cache
updates from releasing suspense.
Modify fetchOptimistic in queryObserver to use Promise.race between
the fetch promise and a cache subscriber that listens for 'updated'
events. When data appears in the cache via setQueryData or a streamed
chunk, the race resolves immediately without aborting the fetch.
This allows the suspense boundary to release and show the available
data while the fetch continues in the background.
Closes#10924
Co-authored-by: atlarix-agent <agent@atlarix.dev>
* chore: add changeset for suspense setQueryData fix
Co-authored-by: atlarix-agent <agent@atlarix.dev>
* fix(query-core): prevent subscription leak in fetchOptimistic on fetch rejection
unsubscribe() was only called in the .then() success path. If
query.fetch() rejected before the cache subscriber resolved the race,
the subscription leaked — staying registered on QueryCache indefinitely
and checking a stale queryHash on every 'updated' event.
Use .finally() to ensure unsubscribe() runs on both success and
rejection, preserving the original promise type through the chain.
Co-authored-by: atlarix-agent <agent@atlarix.dev>
* fix(query-core): settle floating promise in fetchOptimistic and add undefined test
- Resolve the subscriber promise when fetch succeeds so both branches
of Promise.race always settle, avoiding a permanently pending promise
- Move resolution into .then() rather than .finally() so fetch failures
still propagate through Promise.race rejection
- Add test: setQueryData with undefined must NOT release suspense,
documenting the query.state.data !== undefined guard
Co-authored-by: atlarix-agent <agent@atlarix.dev>
* Update packages/query-core/src/queryObserver.ts
* test(queryObserver): cover cached data resolution
---------
Co-authored-by: DeepSeek V4 Pro agent <agent@atlarix.dev>
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
* test(react-query/useQuery.promise): unskip 'cancelQueries' while suspending test by keeping 'queryFn' in-flight
* test(react-query/useQuery.promise): clarify why 'sleep' is extended in cancel-while-suspending test
* test({react,preact}-query/useInfiniteQuery): use the '.then()' convention consistently
* test({react,preact}-query/useMutation): use the '.then()' convention consistently
* test({react,preact}-query/useQueries): use the '.then()' convention consistently
* test({react,preact}-query/useQuery): use the '.then()' convention consistently
* test({react,preact}-query/usePrefetchQuery): inline the 'generateQueryFn' factory into each call site
* test({react,preact}-query/usePrefetchQuery): drop the unnecessary 'vi.fn()' wrapper on the never-asserted sentinel queryFn