New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Ability to merge routers with different contexts #5113
Comments
Just sponsored the issue, hope this can be implemented soon! It is unfortunately blocking the development of my app. |
I'll also sponsor this issue. Primary use-case right now is migrating a Next.js monolith into a separate API server (for other clients to consume). In order to do a piecewise migration, we are experiencing friction when using two separate server endpoints. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the feature you'd like to request
The ability to merge routers that have different contexts into one client. For example a Fastify tRPC server + a Next.js tRPC server that have different purposes, but both need to be consumed by the Next.js app which is not possible at the moment.
Describe the solution you'd like to see
KATT mentioned that really only error formatting needs to be the same, so some new merge routers method that merges any two routers as long as their error formatting is the same.
Describe alternate solutions
The only workaround I can think of off the top of my head is calling the secondary server (in my example, the Fastify server) with
createServerSideHelpers
and then proxying it with a new router inside the Next.js server, although this adds unneeded latency and complexity.Additional information
#5111
👨👧👦 Contributing
Funding
The text was updated successfully, but these errors were encountered: