useInfiniteQuery cache for useQuery
Best explained by example
website.com/todos/
Show all todos with
website.com/todos/{todoId}
Show a specific todo with
Since the keys are different (as infinite query stores a page of data), how might we be able to update the cache manually for the single todo cache?
It seems silly to fetch a list of 10 items and then additionally fetch the same 10 items individually as they are clicked on when we already have them.
website.com/todos/
Show all todos with
useInfiniteQuery , results are stored in cachewebsite.com/todos/{todoId}
Show a specific todo with
useQuery Since the keys are different (as infinite query stores a page of data), how might we be able to update the cache manually for the single todo cache?
It seems silly to fetch a list of 10 items and then additionally fetch the same 10 items individually as they are clicked on when we already have them.