Alan Smithee
TTCTheo's Typesafe Cult
•Created by Alan Smithee on 5/17/2023 in #questions
Prisma in TRPC context
I am still learning how all the pieces of the stack work together, but from my point of view you add the instance in the tRPC's context if you plan to use internally within your components. Making a procedure will allow you to pull/push data right from the procedure and the React Query hooks.i don't mean the trpc client instance that you have in react, i meant the context which you pass to trpc's request handler on the server
7 replies
TTCTheo's Typesafe Cult
•Created by Alan Smithee on 5/17/2023 in #questions
Prisma in TRPC context
You can organize your logic as much as you want but I think that we still need to use the same instance of Prisma.of course, i was just wondering if there was any reason to put the client's instance in trpc's context and if not doing so could bite me in the ass
7 replies