Reusing queries and queryKey variable evaluation
If I include a variable in a query (like the column id for a table) and the components are generated dynamically like so
if I elsewhere try to retrieve the value of the query using a value that I know was passed into the query as a key, like this:
will the dynamically generated query and the manually invoked query match?
1 Reply
correct-apricotOP•3y ago
or for a better example, will these two match assuming they are both supplied "proxyStatus" as the last key?
and
It feels like they should, but it seems clear the two are interfering with each other because when I try to use this method the components don't all render and some produce errors.
I don't have all the information I need in the component or a way to get it there in the way I need it, so is this maybe a case for
queryClient.getCacheData?
Can I have useQueries map over an array and have it generate a query per element, then elsewhere address that element with a single useQuery if I know what the variable is going to be?
I guess it does work like I expect, the issue was an incorrect variable declaration