Closed Evertt closed 1 year ago
Well,
In v1 only useQuery
/useInfiniteQuery
unwrap refs automatically.
In v2 all composables besides useQueries
.
So it is something that needs to be added and possibly back ported to v1
I think so, personally. Like it's just strange that useQuery()
would cloneDeepUnref
the options, but useQueries()
wouldn't. And unfortunately you don't export cloneDeepUnref
, so now I have to copy that function to my own src
folder.
The idea is not to implement it on your side, but contribute to the repository and add a support for it for everyone to use 😉
I tried, and at first it seemed to work, but later it seemed like the attributes that I get back every query, like data
, stopped being reactive. So I went back to 1.25 and my previous workaround. 😬
Wait, that's not precise enough. If I asked for the data
attribute of one of those queries immediately on page load, then it would work. But I also have a popover element, which means that when I hover over an element, a new component appears, that uses the same list of useQueries()
as the first component did. But it gets a different query (at a different index in the list) and then the data
attribute of that query isn't reactive for some reason.
While it was reactive while I was using my workaround. 😅
Few question:
queries
array as reactive
?This should be fixed in @tanstack/vue-query
I mean, I can do it myself, but I thought vue-query was made to do it for me. It works with the normal
useQuery()
.So I'm talking about the
enabled
option for example. Which can be a ref or a computed and then when you use it inuseQuery()
then it automatically unwraps the ref/computed. But when I use it inuseQueries()
I get an error from react-query thatenabled
is not a boolean and indeed, when I check, it is indeed still a computed.Oh yeah I'm using version 1.25.2 btw.