Use ReactQuery to fetch different api resource than trpc resource

I have an api endpoint which I can call using fetch. How one would re-use reactquery and call that endpoint directly. Do I need separate reactquery client?
Solution:
You should already have @tanstack/react-query installed as a dependency, you can just import useQuery from it, it will use the same query client as trpc
Jump to solution
2 Replies
Solution
Matvey
Matvey7mo ago
You should already have @tanstack/react-query installed as a dependency, you can just import useQuery from it, it will use the same query client as trpc
Mugetsu
MugetsuOP7mo ago
Yeah. Exactly what I found just after posting the question 🤦‍♂️ nonetheless thanks for answering as its what I was asking for ! Thank you ❤️

Did you find this page helpful?