query
query copied to clipboard
[vue-query] Callback for enabled does not provide query as parameter
Describe the bug
Since v5.48.0 and the changes in #7566 the enabled
property for TanStack Query in general does accept a callback function, which provides the the query as argument.
Sadly this does not work with vue-query, as vue-query did already accept a getter since #6018, which does not provide the query. It technically is possible to return a function from the getter and that one will provide the query, but that does not fit the current types and docs. In addition it seems to run unnecessarily often, as you can see in my example repro.
Your minimal, reproducible example
https://stackblitz.com/edit/vitejs-vite-dt8byq?file=src%2FApp.vue
Steps to reproduce
- Open the console
- The parameter
outerQuery
inundefined
Expected behavior
The parameter outerQuery
to be the query
Tanstack Query adapter
vue-query
TanStack Query version
5.51.21