Can't get query data
I've constructed a query key for a paginated list with filters and sorting like this:
I'm trying to get the query data like this:
What am I doing wrong? Why can't I get the whole data with just
['products'] ?5 Replies
rare-sapphire•4y ago
Because there are multiple cache entries. Try getQueriesData, it matches fuzzily
other-emeraldOP•4y ago
Ty! Is this the right way to create the query keys? Or should I change something?
Might try the query key factory
rare-sapphire•4y ago
it's fine
other-emeraldOP•4y ago
alright, ty!
@TkDodo 🔮 if I want to do optimistic updates with this should I also use
setQueriesData? Or does setQueryData works fine? 🤔rare-sapphire•4y ago
one sets it for all keys, the other doesn't