Sindre
Good patterns for large list querys? Invalidation & refetching gets slow after a mutation
We have several large lists where we invalidate the query after editing an item. What are some good patterns for this? The network lag starts adding up for the customers with more data. Ironically those who use us the most π
Is it "good practice" to edit the list query cache directly in the mutation onSuccess? Or necessary to refactor the list querys to be smaller, through server filters or infiniteQuery?
Especially painful in a view where we have two lists where the user can connect items from one list to the items in the other list. Requiring both list queries to be invalidated. Better to make the "connections" mapping its own api procedure and only invalidate that? Or combine all three to one query, set the cache state manualle in the mutation onSuccess?
Kind of a react-query question I know, just wondering if anyone here has faced it. And if it has been written about
Kind of a react-query question I know, just wondering if anyone here has faced it. And if it has been written about
5 replies