RFC: @urql/vue - Allow getter syntax in useQuery
#3556
Labels
future 🔮
An enhancement or feature proposal that will be addressed after the next release
useQuery
#3556
Summary
In Vue, if we use component props in the
variable
object of theuseQuery
composable, their reactivity is lost in the process and this results the same as if it was passed as a constant. To avoid this, the solution is to wrap thevariable
object in atoRef
, using a getter function.Allowing to pass directly the getter function to the
variable
property, as VueUse is doing with theirMaybeRefOrGetter
type, would be more fluent.Proposed Solution
Check if the passed
variable
arg is a function, and if yes, unwrap it when needed (see VueUseuseFetch
composable and how they does it?)The text was updated successfully, but these errors were encountered: