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

685 commits

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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-21 11:29:33 +02:00
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
Ahmet Tınastepe
12027efd5c
fix(vue-query): widen 'queryOptions' input to match 'useQuery' (#11439)
* fix(vue-query): widen 'queryOptions' input to match 'useQuery'

* chore: generate-docs

* chore: changeset

---------

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-09-15 09:00:40 +02:00
Bart Spaans
2bc8ecf39b
fix(vue-query): re-export core filter types (#11287)
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-09-14 16:12:52 +02:00
Wonsuk Choi
7452ef68a2
test({vue,svelte}-query): add type tests for inferring the result type from a generic 'queryFn' (#11464)
* test(vue-query/useQuery): add type test for inferring the result type from a generic 'queryFn'

* test(svelte-query/createQuery): add type test for inferring the result type from a generic 'queryFn'
2026-09-10 09:26:52 +09:00
Wonsuk Choi
16aed4e1a4
test(vue-query/useMutation): add tests for per-call callbacks passed as arguments of 'mutate'/'mutateAsync' (#11459) 2026-09-09 23:33:01 +09:00
Wonsuk Choi
1fd3f61895
test(vue-query/useMutation): add tests for 'MutationFunctionContext' passed to mutationFn and callbacks (#11444)
* test(vue-query/useMutation): add tests for 'MutationFunctionContext' passed to mutationFn and callbacks

* test(vue-query/useMutation): assert 'context' type for 'mutationFn' as well

* test(vue-query/useMutation): drop redundant type annotation from 'mutationFn' params in context test

* test(vue-query/useMutation): rename 'mutationFn' param to '_variables' for consistency
2026-09-09 09:39:53 +09:00
Wonsuk Choi
e57f8163b1
docs(query-core): add JSDoc across the package and expose it in generated reference docs (#11438)
* docs(query-core): add JSDoc across the package and expose it in generated reference docs

* docs(config.json): add sidebar entries for newly generated query-core reference docs

* docs(query-core): migrate remaining prose from the legacy 'docs/reference' pages into JSDoc

* docs(query-core): remove legacy 'docs/reference' pages superseded by the generated reference

* docs(query-core): regenerate reference docs after merging main

* docs(query-core): document missing default values for MutationOptions, combine, and QueryFilters.type

* fix(query-devtools): drop unnecessary 'query-core' project reference

* docs(query-core): document missing default values and normalize 'Defaults to' spacing

* docs(query-core): fix 'environmentManager' JSDoc example
2026-09-07 18:22:38 +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
1893a965d2
test(vue-query/useMutation): add tests for optimistic update rollback and concurrent 'mutate'/'mutateAsync' calls (#11403) 2026-09-05 15:52:47 +09:00
Wonsuk Choi
aeeded4c2e
test(vue-query/useInfiniteQuery): add tests for 'maxPages' getter reactivity, 'hasNextPage' transitions, and 'queryKey' getter rejection (#11402) 2026-09-05 15:52:32 +09:00
Wonsuk Choi
0da5ce88fc
test(vue-query/useQuery): add tests for 'select', 'enabled' getter, 'initialData', 'keepPreviousData', and 'queryKey' getter reactivity rules (#11401)
* test(vue-query/useQuery): add tests for 'select', 'enabled' getter, 'initialData', 'keepPreviousData', and 'queryKey' getter reactivity rules

* test(vue-query/useQuery): split 'initialData' test into seeding and background refetch cases
2026-09-05 15:52:14 +09:00
Wonsuk Choi
309508612a
docs(vue-query): add JSDoc and generate reference docs with TypeDoc (#11378)
* docs(vue-query): add JSDoc across the package

* docs(vue-query): generate reference docs with TypeDoc

* docs(config): register vue-query TypeDoc reference pages

* docs(vue-query): preserve dehydrate/hydrate option docs and fix reference links

* docs(config): reorder vue-query reference nav to list 'Functions' first

* docs(config): reorder vue-query 'Functions' entries to match react/preact grouping

* docs(vue-query): restore Suspense guide link and 'placeholderData' behavior note lost in TypeDoc migration

* docs(vue-query): correct JSDoc accuracy issues and reactivity bugs

* docs(vue-query): fix invalidateQueries example that invalidated every query, add whole-options getter example

* docs(vue-query): add examples for the mutationOptions and useInfiniteQuery getter overloads

* docs(vue-query): add react-parity examples for select, skipToken, keepPreviousData, optimistic updates, and infinite scroll

* docs(vue-query): add queryOptions select typing example to useQueries

* docs(vue-query): disconnect IntersectionObserver on unmount, drop non-null assertion in skipToken examples

* docs(vue-query): add 'skipToken' factory example to 'queryOptions'

* docs(vue-query): correct 'queryKey' reactive-getter claim in 'useQuery'/'useInfiniteQuery'

* docs(vue-query): correct 'queryKey' reactive-getter claim in 'QueryOptions' type JSDoc

* docs(vue-query): fix reversed claim that 'queryKey' entries can't be reactive getters
2026-09-05 13:29:11 +09: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
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
Ben Younes
b8517d3173
docs(vue-query): explain why reactive() is needed for result narrowing (#10580)
The type narrowing example wraps useQuery() in reactive() without saying
why, so destructuring the result directly and then checking isSuccess
looks like it should work (#9244). Spell out that reactive() is what
flattens the refs into one discriminated union, and show the
data.value !== undefined check as the alternative when reactive() is not
an option.

Pin both shapes with type tests: the non-reactive result exposes
Ref<T> | Ref<undefined>, and narrowing on data.value refines the ref
itself.

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-08-22 10:20:36 +02:00
Wonsuk Choi
9fa03e65b6
test(vue-query/useQuery): move suspense regression tests into 'useQuery.test.ts' (#11250) 2026-08-22 12:28:00 +09:00
Wonsuk Choi
eeb9820952
test(vue-query): add regression tests for suspense release on programmatic 'setQueryData' (#11249) 2026-08-22 11:48:04 +09:00
Ciarán Curley
97ce30b51e
Vue: add new impertive methods to vue proxy QueryClient (#11208)
* feat(vue-query): add new methods to vue-query

* docs(vue-query): docs for new impertive methods for Vue

* fix(vue-query): remove getter options from impertive methods

There is no evidence that the () => queryOptions getter type is
properly used by `fetchQuery` et al, as while it accepts a getter in the
types, it doens't resolve the function at runtime (as opposed to
`useQuery`). Removing the type from `query` and `fetchQuery` and
documenting calling getters impertivly as a workaround.

* Update packages/vue-query/src/queryClient.ts

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

* Update packages/vue-query/src/usePrefetchQuery.ts

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

---------

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-08-20 17:12:42 +02:00
Dominik Dorfmeister 🔮
294d4e62c4
fix: declaration emit (#11224)
Co-Authored by @artemxknpv
2026-08-18 17:48:33 +02:00
Ben Younes
5199f0884c
fix(vue-query): preserve TQueryKey inference with generic params (#8199) (#10584)
* fix(vue-query): preserve TQueryKey inference with generic params (#8199)

The mapped UseQueryOptions type wrapped queryKey in
MaybeRefDeep<DeepUnwrapRef<TQueryKey>>. The recursive DeepUnwrapRef on a
generic TQueryKey is opaque to TS's homomorphic mapped type inference,
so TQueryKey collapsed to its default (QueryKey) when useQuery was
called from a composable that propagates a generic into the queryKey.

For the queryKey property only, drop DeepUnwrapRef and use a single-
level MaybeRef<TQueryKey> wrap. Inference now binds TQueryKey to the
supplied queryKey shape; queryFn still receives DeepUnwrapRef<TQueryKey>
via the existing mapping for non-queryKey properties.

Co-Authored-By: Ora Studio <noreply@oratelecom.net>

* test(vue-query): strengthen #8199 regression assertion with explicit TData

Per CodeRabbit feedback: bare assertType(useBasket('fruit')) only verified
the call compiled, which would still pass under the old buggy behavior
(TQueryKey collapsing to QueryKey, TData inferred as unknown). Lock the
regression by asserting the propagated TData explicitly.

---------

Co-authored-by: Ora Studio <noreply@oratelecom.net>
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-08-18 17:44:01 +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
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
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
github-actions[bot]
86bb8a6fb2
ci: Version Packages (#11094)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-21 15:00:30 +02:00
github-actions[bot]
181ea826cb
ci: Version Packages (#11089)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-20 14:01:04 +02:00
max
79d2384db5
docs(*): fix 'homogenous', 'stoage', 'supressed', 'compoennts' spelling typos (#11040)
* fix: correct spelling typos across docs, examples, and source comments

- homogenous -> homogeneous in 7 useQueries/createQueries source files
- stoage -> storage in react and vue createPersister docs
- supressed -> suppressed in react and angular pagination examples
- compoennts -> components in solid-start-streaming example

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(react-query/useSuspenseQueries): correct 'homogenous' typo to 'homogeneous' in comment

---------

Co-authored-by: maxtaran2010 <ocotifuzo727@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Wonsuk Choi <sukvvon@gmail.com>
2026-07-13 14:06:03 +09:00
Wonsuk Choi
045c947f2a
test(*): assert exact values instead of loose matchers (#11057) 2026-07-13 02:27:36 +09:00
Wonsuk Choi
fb8f4745d7
test(vue-query/{usePrefetchQuery,usePrefetchInfiniteQuery}): assert exact prefetch options instead of 'objectContaining' (#11056) 2026-07-13 01:56:30 +09:00
Wonsuk Choi
aa1f9d7bf1
test({vue,angular}-query): pin the reactive refetch call with 'toHaveBeenNthCalledWith' (#11051) 2026-07-12 12:09:38 +09:00
Wonsuk Choi
72e90c88eb
test(vue-query/vueQueryPlugin): assert exact booleans with 'toBe' instead of 'toBeTruthy'/'toBeFalsy' (#11049) 2026-07-11 15:03:21 +09:00
Wonsuk Choi
0cdfdea388
test(query-core/utils,vue-query/mutationOptions): assert reference identity with 'toBe' (#11048) 2026-07-11 14:52:39 +09:00
Wonsuk Choi
f79938ea08
test(vue-query/useQueries): replace 'toMatchObject' with 'toEqual' (#11046) 2026-07-11 13:32:40 +09:00
github-actions[bot]
610e8d1684
ci: Version Packages (#10996)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-27 22:28:10 +02:00
github-actions[bot]
b80929716f
ci: Version Packages (#10977)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-23 11:57:22 +02:00
Wonsuk Choi
a7b783a5ed
test(vue-query): replace deprecated 'toBeCalledWith' with 'toHaveBeenCalledWith' (#10968) 2026-06-17 19:50:09 +09:00