Reactive queryKey with vue-query? #4332
-
Greetings, I have a queryKey like this: How can I make the queryKey change when the props.id or my ref/computed changes which should trigger the query to reload? What are the other options? Also, how can I access the key from a mutation function? Many thx! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
All Query key can be accessed from the |
Beta Was this translation helpful? Give feedback.
All
ref
andcomputed
provided as a part ofqueryKey
oroptions
will be automatically observed and changes would be reflected with the Observer.Query key can be accessed from the
queryFn
context: https://vue-query-next.vercel.app/#/guides/query-functions?id=query-function-variables