ampp
ampp•9mo ago

Different ways of caching queries on the client

I've scanned the docs but have one question, How does the new Query Cache compare to useStableQuery/useStablePaginatedQuery? Are those to generally be used with Query Cache or are they now a inferior option?
2 Replies
Michal Srb
Michal Srb•9mo ago
They are both client-side cache implementations. The cool thing about the new Query Cache is that it stays subscribed for a period of time. It always gives you consistent results. useStableQuery/useStablePaginatedQuery are much simpler, and their goal is to keep around the result of the previous query call (so usually the arguments changed, and you want to show the "stale" result from running the query with the previous arguments). So yeah, you can combine them! (you'll have to write your own version of the useStableQuery/useStablePaginatedQuery that use the Query Cache).
ampp
amppOP•9mo ago
Thanks for the clarification. 🙂

Did you find this page helpful?