tRPCttRPC
Powered by
LukaL
tRPC•3y ago•
12 replies
Luka

Merging two clients into one

I have two clients. One for react-query for client components and one for server components. I wanna be able to call .query() or .useQuery() from the same object so you get one object for API calling on both server and client.

I tried combining the two client objects with Object.assign. The types work as you can see in the screenshot but the object returned from Object.assign is empty. Wanna know what's the reason for that or what's the better way of doing this
image.png
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Is it ok to have 2 clients in one app
sevenSseven / ❓-help
2y ago
onSuccess and onError in one time
SzymonSSzymon / ❓-help
15mo ago
merging other routers to appRouter
NazCodelandNNazCodeland / ❓-help
3y ago