T
TanStack4y ago
absent-sapphire

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
harsh-harlequin4y ago
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-sapphire
absent-sapphireOP4y ago
ah, thank you! probably overkill for my use case is there a way to not cache a query within useQuery?

Did you find this page helpful?