How are the cache keys handled under hood? Let's say I visited a page where user has a list of favorite items. Then the user visits an item's page. On this page, I could access the cache and if the item is in the list save an API call. But I couldn't access the query cache key.
So I checked React Dev Tools, went to QueryClientProvider on components and checked client. QueryCache element is there; so clicked on it and found that it only contains the most recent page's queries cached. If I am on favorites page it will be something like:
1. ["auth/me"]
2. ["favorites-endpoint-url"]
And if I go another page, "favorites-endpoint-url" won't be in the cache keys anymore. Instead
Is there a bug? Or is there something that I should be doing other than providing the query function and data to useQuery (I thought cache key creation was handled by Wasp)? Or am I just looking at the wrong place?