createTRPCNext and createTRPCProxyClient within one NextJs app

Sshovancak5/3/2023
Hey, Is there any possibility to use createTRPCNext and createTRPCProxyClient clients in one NextJs app? I have a use-case where I need to use a vanilla client to fetch data in my app but I don't want to lose the possibility of using useQuery and useMutation hooks in my components.
Nnlucas5/3/2023
You can use both, it might be a code smell if there’s a better way but they shouldn’t conflict with each other
Sshovancak5/3/2023
But what about things like caching or query invalidation? Client created by createTRPCProxyClient use tenstack react query it is handled out of the box 🤔.
Sshovancak5/3/2023
This can be problem in case of vanilla client
Nnlucas5/3/2023
Yep, that’s your trade off
Sshovancak5/3/2023
Thank you 👍
Mmossmossmossmoss5/9/2023
Im also running into this issue today, would be cool if there was a way you could pass the client created from createTRPCProxyClient into createTRPCNext so you're sharing the instance between them.
Mmossmossmossmoss5/10/2023
Or better, a way to access the underlying trpc client created by createTRPCNext