If I do not pass a variable into query key, and what will happen? #4963
Answered
by
DamianOsipiuk
AaronConlon
asked this question in
Q&A
-
Hi there.I see this description in doc:
So, I want to know.If I forget to pass a variable include into my query key and what will happen.Thanks. |
Beta Was this translation helpful? Give feedback.
Answered by
DamianOsipiuk
Feb 10, 2023
Replies: 1 comment
-
In this case whenever this variable changes, your query would not update. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
AaronConlon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In this case whenever this variable changes, your query would not update.
You could treat it as a dependency array like in other react hooks.
Additionally based on
queryKey
, cache entry is created. So if you do not include changing variable inqueryKey
, different queries might want to store data in the same place.