Skip to content

Document vue-query's reactivity #5912

Discussion options

You must be logged in to vote

I agree that such page might be handy. Especially for people moving from other frameworks.

As a rule of thumb, everything that you are passing to useQuery options should be reactive/ref, so library will be aware of the changes of those values. Vue-Query will unwrap them internally.

As for the queryFn - it's a plain JS function out of control of vue-query, so you have to be aware of what you are using.
id that you are getting from the queryFn context is in unwrapped state already, so can be used as-is. But if you are referencing ref not via context, you need to unwrap it manually.
Typescript should help you with that, hinting what is what.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
3 replies
@KazimirPodolski
Comment options

@DamianOsipiuk
Comment options

@KazimirPodolski
Comment options

Answer selected by KazimirPodolski
Comment options

You must be logged in to vote
3 replies
@DamianOsipiuk
Comment options

@KazimirPodolski
Comment options

@DamianOsipiuk
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants