T
TanStack3y ago
fascinating-indigo

getQuery for key with all possible ids

Say i fetch todo like ['todo', { id}] but while getting the todo data I want to get for all possible Id's. In a way expectation is to do getQuery(['todo']) to get todos for id1, id2..... Is there an existing functionality to achieve the same?
3 Replies
other-emerald
other-emerald3y ago
queryClient.getQueriesData
ratty-blush
ratty-blush3y ago
Why not using the select option to get just the id's from the 'todo' key?
xenial-black
xenial-black3y ago
Because the select function enables you to select a slice of data from a query. They want to get the data for multiple queries, hence getQueriesData

Did you find this page helpful?