add items in cache manually
Hello, I am dealing with a tree data structure, when the root is fetched, I want to add all individual nodes into the cache, so that when they are updated, only that one is updated
4 Replies
stormy-goldOP•3y ago
e.g i want to cache all
["todos", #] when i fetch "todos"stormy-goldOP•3y ago
Initial Query Data | TanStack Query Docs
There are many ways to supply initial data for a query to the cache before you need it:
Declaratively:
stormy-goldOP•3y ago
i was looking for this
OK, no my server is being spammed because I have waay too many nodes and queries, is there a way to disable auto refetching and only fetch when a query key is invalidated?
continuing-cyan•3y ago
staleTime: Infinity