Updating multiple query keys from an API with a batched endpoint
Hey, I'm querying an API with an endpoint someting like:
api/prices/asset1,asset2,asset3
You can request the prices of as many assets as you wish. Is there a way I can use useQuery (or similar) to request this data, but then cache against a set of query keys rather than a single one?2 Replies
harsh-harlequin•4y ago
you can do this with dataloader:
https://github.com/TanStack/query/discussions/365#discussioncomment-1867860
GitHub
Batching · Discussion #365 · TanStack/query
So yesterday I wrote up some thoughts on batching (see https://github.com/tannerlinsley/react-query/discussions/364), but this was too eager of me. For proper support of batching, it would be reall...
absent-sapphireOP•4y ago
ah, thank you!
probably overkill for my use case
is there a way to not cache a query within useQuery?