yo! :prisma-rainbow: I’m working on an insanely c...
# madewithprisma
k
yo! prisma rainbow I’m working on an insanely cool thing with tRPC.io! Typesafe HTTP/DB batching (without graphql or swagger or any other schemas!) This code below (that sits on top of react-query) produces: • exactly one HTTP call (thanks to a a new tRPC-feature), and • exactly one
SELECT
(thanks to prisma’s built-in batching) 👉 have a play with it here: https://codesandbox.io/s/github/trpc/trpc/tree/feature/links/examples/next-prisma-starter?file=/src/pages/batching.tsx:226-430
💯 1
prisma rainbow 5
from the terminal 👇
p
This is awesome! Been using trpc for a few months now after searching for a solution to get the pure magic that blitz has with next+prisma without the need to manage an api layer in between and duplicating ts types. This showcase takes it one step further with optimizing performance without sacraficing anything! Its just amazing how far trpc has come
❤️ 1
Prisma's approach to type-safe ORM is next-level when compared to sequelize and even TypeORM, specifying types specifically on each select statement as opposed to assuming the entire model is available, but once the browser fetches it (even when using nexus with graphql) the types get messy and one usually ends up writing interfaces and types in the frontend (extending from prisma models). trpc + prisma combo is mindblowing how insanely easy it is to just get going with full type-safety without any codegen or messy types and interfaces to write and maintain