Description
mutationInvalidates works on react-query, svelte-query, and angular-query but is a no-op on vue-query. Same config, no codegen difference, no warning. Asking for vue-query parity.
Current behavior
With client: 'vue-query' and a query.mutationInvalidates rule, the generated mutation hook does not get the queryClient parameter, the skipInvalidation option, or the onSuccess invalidation block. The rule is silently ignored.
The Vue adapter explicitly opts out in packages/query/src/frameworks/vue.ts:
supportsMutationInvalidation() { return false },
generateMutationOnSuccess() { return '' },
…which the shared generator gates on:
const hasInvalidation =
uniqueInvalidates.length > 0 && adapter.supportsMutationInvalidation()
Versions: orval@8.11.0, @tanstack/vue-query@5.x.
Proposed behavior
When client: 'vue-query' matches a mutationInvalidates rule, emit the same queryClient / skipInvalidation / onSuccess-invalidation surface as the React Query output (adjusted for Vue's TanStack v5 onSuccess signature, which the adapter already tracks via hasQueryV5WithMutationContextOnSuccess / hasQueryV5WithRequiredContextOnSuccess).
Proposed solution
Port the React adapter's mutation-invalidation methods into packages/query/src/frameworks/vue.ts: flip supportsMutationInvalidation() to true, implement generateMutationOnSuccess, and update generateMutationImplementation / generateMutationHookBody to thread queryClient and a useQueryClient() fallback. The shared mutation-generator.ts already handles cross-file getYyyQueryKey imports once the adapter opts in.
solid-query is in the same state and is a candidate for the same change.
Happy to PR if someone can confirm the approach.
Description
mutationInvalidatesworks onreact-query,svelte-query, andangular-querybut is a no-op onvue-query. Same config, no codegen difference, no warning. Asking for vue-query parity.Current behavior
With
client: 'vue-query'and aquery.mutationInvalidatesrule, the generated mutation hook does not get thequeryClientparameter, theskipInvalidationoption, or theonSuccessinvalidation block. The rule is silently ignored.The Vue adapter explicitly opts out in
packages/query/src/frameworks/vue.ts:…which the shared generator gates on:
Versions:
orval@8.11.0,@tanstack/vue-query@5.x.Proposed behavior
When
client: 'vue-query'matches amutationInvalidatesrule, emit the samequeryClient/skipInvalidation/onSuccess-invalidation surface as the React Query output (adjusted for Vue's TanStack v5 onSuccess signature, which the adapter already tracks viahasQueryV5WithMutationContextOnSuccess/hasQueryV5WithRequiredContextOnSuccess).Proposed solution
Port the React adapter's mutation-invalidation methods into
packages/query/src/frameworks/vue.ts: flipsupportsMutationInvalidation()totrue, implementgenerateMutationOnSuccess, and updategenerateMutationImplementation/generateMutationHookBodyto threadqueryClientand auseQueryClient()fallback. The sharedmutation-generator.tsalready handles cross-filegetYyyQueryKeyimports once the adapter opts in.solid-queryis in the same state and is a candidate for the same change.Happy to PR if someone can confirm the approach.