0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
Commit graph

941 commits

Author SHA1 Message Date
github-actions[bot]
c08f5766dd
ci: Version Packages (#11511)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-16 16:56:55 +02:00
github-actions[bot]
19ccf2794b
ci: Version Packages (#11339)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-16 09:03:53 +02:00
Wonsuk Choi
2da46cd137
chore(*): use eslint description syntax for grandfathered 'no-restricted-syntax' disables (#11508) 2026-09-16 10:43:43 +09:00
Dominik Dorfmeister 🔮
58ad3e2f08
fix: isolate TypeScript test output (#11503) 2026-09-15 20:56:41 +02:00
Ciarán Curley
d63afc715c
Simplifed query methods/internal tests new lint (#11347)
* chore: update type tests to use new query methods, types

* chore: disallow future calls to deprecated methods

* fix(eslint): detect computed query method calls

- Match bracket notation for deprecated query client methods
2026-09-15 20:25:08 +02:00
Wonsuk Choi
23fbdc3e89
test({react,preact,solid,angular}-query): remove 'fromGenericOptionsQueryFn' duplicating 'fromGenericQueryFn' (#11463) 2026-09-10 09:26:39 +09:00
Wonsuk Choi
50680b98c4
test({react,preact,solid,svelte}-query,angular-query-experimental): rename 'mutationFn' param to '_variables' in 'MutationFunctionContext' tests (#11448) 2026-09-08 21:22:31 +09:00
Wonsuk Choi
0b326b6b67
test({react,preact}-query/useMutation): add tests for 'MutationFunctionContext' passed to mutationFn and callbacks (#11440) 2026-09-08 19:31:56 +09:00
Dominik Dorfmeister 🔮
a1119e5a3f
ref(hydration): remove outdated dehydratedAt fallback (#11436)
* ref(hydration): remove outdated dehydratedAt fallback

* ref: remove two more unnecessary dehydratedAt undefined checks

* fix constructing PersistedClient in test
2026-09-06 18:09:10 +02:00
Wonsuk Choi
1a51bb80bf
docs(*): clarify 'Promise.all' only waits for all mutateAsync calls when they succeed (#11435) 2026-09-07 00:31:27 +09:00
Wonsuk Choi
8d1981044f
test({react,preact}-query/useInfiniteQuery): assert 'queryFn' call count in skipToken test (#11433) 2026-09-06 23:23:39 +09:00
Wonsuk Choi
8441a6aa7b
test({react,preact}-query/useMutation): add tests for optimistic update rollback and success paths using cache-based 'onMutateResult' (#11421) 2026-09-06 22:48:50 +09:00
Wonsuk Choi
f7bbaed310
test({react,preact}-query/useQuery): add test for 'initialData' with a failed refetch (#11420) 2026-09-06 22:47:51 +09:00
Wonsuk Choi
2a26acc0df
test({react,preact}-query/useInfiniteQuery): add tests for 'initialData' with a failed refetch and 'skipToken' dependent query (#11419)
* 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
2026-09-06 22:47:16 +09:00
Wonsuk Choi
fe77cdc8d7
docs({react,preact,solid}-query): correct inaccurate JSDoc statements (#11372)
* docs(react-query): correct inaccurate JSDoc statements

* docs(preact-query): correct inaccurate JSDoc statements

* docs({react,preact,solid}-query): stop implying useQueries options are fully identical to useQuery
2026-09-03 10:42:36 +09:00
Wonsuk Choi
4c568a28c8
docs(react-query): generate reference docs with TypeDoc (#11366)
* 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
2026-09-02 16:06:54 +09:00
Wonsuk Choi
40cb38d2ea
docs(react-query): add JSDoc across the package (#11362)
* 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
2026-09-02 13:00:21 +09:00
Ciarán Curley
1566c16de7
chore: use infiniteQuery instead of fetchInfiniteQuery et al (#11344)
* 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>
2026-08-31 14:06:43 +02:00
Ciarán Curley
6f31ef6c8b
test: replace 'prefetchQuery'/'fetchQuery'/'ensureQueryData' with 'query' (#11340)
chore: move internal tests to queryClient.query
2026-08-31 09:00:15 +02:00
github-actions[bot]
2969edf32f
ci: Version Packages (#11316) 2026-08-28 01:03:02 +09:00
github-actions[bot]
2eb3c7c76f
ci: Version Packages (#11313)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-27 17:28:48 +09:00
github-actions[bot]
714df67ab1
ci: Version Packages (#11306)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-26 20:32:28 +02:00
alex-js-ltd
ac2b61230e
fix(react-query): propagate falsy errors to the error boundary (#11305)
* 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
2026-08-26 15:27:28 +02:00
github-actions[bot]
1836e61b8c
ci: Version Packages (#11303)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-26 10:56:25 +02:00
github-actions[bot]
51f12db919
ci: Version Packages (#11294)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-25 23:24:07 +02:00
github-actions[bot]
730b3aa06c
ci: Version Packages (#11276) 2026-08-25 04:21:47 +09:00
github-actions[bot]
388bbaf181
ci: Version Packages (#11265)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-23 19:57:36 +02:00
github-actions[bot]
bc423b37ef
ci: Version Packages (#11261)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-23 12:57:01 +02:00
Wonsuk Choi
be1352b848
test(*): add adapter-level type coverage for optional undefinable mutate variables (#11257) 2026-08-23 12:08:14 +09:00
github-actions[bot]
5743468462
ci: Version Packages (#11206)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-22 20:52:42 +02:00
Định Lê
2215bb0311
fix(query-core): make MutateFunction optional undefinable-variables (#8737)
* feat(query-core): make `MutateFunction` optional undefinable-variables

* test(query-core): MutateFunction

* test(query-core): MutateFunction

* vue

* ci: apply automated fixes

* angular

* fix adapter signatures

* ci: apply automated fixes

* changeset

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-22 11:24:11 +02:00
Dominik Dorfmeister 🔮
d156adcc15
test: transition tests (#11246)
* test: transition tests

* Apply suggestions from code review

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-08-21 21:08:04 +02:00
Dominik Dorfmeister 🔮
37127dbe47
fix/11018 (#11245)
* revert: remove NoInfer from useQuery return types

* add union type tests

* changeset
2026-08-21 16:22:28 +02:00
Ciarán Curley
e6748265c8
React: update usePrefetchQuery to use new methods, plus react adaptor tests and docs (#10668)
* feat(react-query): update usePrefetchQuery to use new imperitive methods plus tests

* docs(react-query): new docs for usePrefetchQuery

* Update .changeset/warm-candies-like.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update packages/react-query/src/usePrefetchInfiniteQuery.tsx

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>

* Update packages/react-query/src/usePrefetchQuery.tsx

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-08-20 18:35:32 +02:00
Kushida
88342670ec
fix(react-query): keep unsubscribed useQueries idle (#11130) 2026-08-20 17:32:09 +02:00
Dominik Dorfmeister 🔮
1ef42087c9
ref: remove experimental_prefetchInRender (#11221) 2026-08-20 11:32:10 +02:00
Dominik Dorfmeister 🔮
b866a95add
ref: remove unused experimental_beforeQuery and experimental_afterQuery (#11233) 2026-08-19 20:34:40 +02:00
Dominik Dorfmeister 🔮
fb6c3fabda
fix(react): switch to export type * (#11228) 2026-08-18 21:20:11 +02:00
Dominik Dorfmeister 🔮
294d4e62c4
fix: declaration emit (#11224)
Co-Authored by @artemxknpv
2026-08-18 17:48:33 +02:00
Dominik Dorfmeister 🔮
267154cf6b
chore: tsup -> tsdown (#11222)
* 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
2026-08-18 15:19:43 +02:00
Lazizbek Ergashev
cb6c9d3725
fix({react,preact}-query): default 'TData' of infinite query options to 'InfiniteData' (#11147)
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-08-18 10:51:47 +02:00
Reza Rahemtola
e546d03bef
fix(react-query): remove placeholderData from suspense infinite query (#11144)
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-08-18 10:44:27 +02:00
Zelys
6e3d521fe5
fix(types): propagate generic type params to useMutationState select callback (#10373)
* 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>
2026-08-18 10:02:05 +02:00
Dominik Dorfmeister 🔮
279bb5508b
chore: update to ts 7 and move cut-off to 5.6 (#11212)
* update to ts 7 and move cut-off to 5.7

* changeset

* fix: use typescript v6 with tsup

* ci: apply automated fixes

* ref: update sveltejs/package

* ref: make ts6 the default typescript

* fix: lit build

* effing tsup

* move ignoreDeprecations to solid tsup config

* move ignoreDeprecations to relevant tsup configs

* better lit fix

* restore vue queryClient

* Revert "restore vue queryClient"

This reverts commit 4f95fc918a.

* fix things

* ignore devDep ordering

* vue needs to use ts6

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-17 22:50:18 +02:00
Ciarán Curley
c6fc17cfad
feat(query-core): add simplified query methods (#10658)
* feat(query-core): add simplified query methods

* tests: stage adapter queryOptions coverage for new query methods

* ref: disallow `enabled`

* ci: apply automated fixes

* remove outdated test

* test(lit): remove other outdated test

---------

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-17 13:59:13 +02:00
Amariah Abishai
bef4bc780c
fix(query-core): resolve suspense when query data is set programmatically (#11036)
* 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>
2026-08-17 10:19:39 +02:00
Alem Tuzlak
46d7f02f1c
docs: use the dynamic README header endpoint (#11136)
* docs: use the dynamic README header endpoint

* docs: add README header banners to the framework adapter packages
2026-08-03 13:43:19 +02:00
Wonsuk Choi
9d24c45545
test(react-query/useQuery.promise): unskip 'cancelQueries' while suspending test by keeping 'queryFn' in-flight (#10910)
* 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
2026-07-29 10:03:48 +09:00
Wonsuk Choi
fbe532c477
test({react,preact}-query): replace 'toBeDefined'/'toBeFalsy' with exact-value assertions (#11123)
test({react,preact}-query): assert exact values instead of loose matchers
2026-07-27 00:57:58 +09:00
SiHyunLee
a3b0612729
test({react,preact}-query/usePrefetchQuery): use the '.then()' convention consistently (#11091)
Co-authored-by: Wonsuk Choi <sukvvon@gmail.com>
2026-07-24 12:30:17 +09:00