Issues with queryKey
I am trying to assign dynamic keys to queryKey for my procedure so I can check if the query key exists, if it doesnt then simply refetch the query.
I am unable to find anything online so this is my last stop.
When I am logging queryKeys using getQueryKey then in the output I am getting these two keys only.
If any of you need more context on why I am doing this, feel free to ask.
Please help!
2 Replies
Not sure if this would help but I use dynamic query keys like this: And to only fetch based on a condition you can use the attribute
Yes, thats how I used useQuery outside of tRPC. But here it just gets angry at me
if I pass any string to it