tRPCttRPC
Powered by
ianI
tRPC•2y ago•
2 replies
ian

Complex type inference on router outputs?

What are the best practices on complex outputs from routers and typing on the FE? We are doing quite a bit of munging of data from multiple sources, so there's no real concept of an upstream "primitive" as there would be in a simple trpc + nextjs + prisma setup.

How is everyone doing typing in a scenario like this? It feels brittle to bind a UI element to the response from a router as that will intrinsically bind those two elements together, making the component non-reusable.

Is there a typing layer for trpc that sorta behaves like GQL, where you get a meta layer of types from the router responses?
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

Type too complex to infer?
hashwarpHhashwarp / ❓-help
2y ago
Incomplete imported router type
Mr. JokerMMr. Joker / ❓-help
10mo ago
Incorrect type inference with discriminated unions.
dechoDdecho / ❓-help
3y ago
Losing type inference in vs-code
La grande murailleLLa grande muraille / ❓-help
3y ago