Hacker News new | ask | show | jobs
by numinoid 1193 days ago
tRPC on the back end essentially is sharing the typed return value of an API route call with it's react query wrapper on the client. It's useful with Prisma because you can leverage type inference coming from the Prisma query, meaning your types will always be up to date with your DB. EG a tRPC query that returns prisma.posts.findMany() will share the typeof Post with your client when you call the tRPC route as the return type of the API call, without you having to do any type definitions etc.