* 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
* 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'
* 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
* 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
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>
* 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>
* 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>
* 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>