T
TanStack3y ago
dependent-tan

Create and Get Queries outside of components

I'd like to setup and retrieve the query object that useQuery provides outside of a component. I saw that I can use the setDefaultQuery-Fn from my queryClient. What can I to call to retrieve that object? More context: I'm using TanStack Query in vue through vue-query. I have composable stores (that just keep refs). I have jest tests for those. I can't do useQuery inside of those stores in the tests because it relies on a Vue app instance. Im managing singletons through a ServiceContainer package. I've stuffed my queryClient there.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?