cadams
cadams
Explore posts from servers
TTCTheo's Typesafe Cult
Created by cadams on 12/12/2023 in #questions
Correct if wrong: Since a tRPC procedure is a hook, they cant be used in the next api/ routes
Hooks can only be used inside components - this makes me think how limiting tRPC is if it can only be used from the front end :/ ? I have a procedure that my front end uses, now I want the backend (in next api/ route) to use this procedure too and send an email. I know there are a lot questions around using tRPC procedures outside a project (https://github.com/jlalmes/trpc-openapi i think this solves that dilemma), this is similar that I what to use the procedure, but just from the backend in the same project.
5 replies
TTCTheo's Typesafe Cult
Created by cadams on 12/9/2023 in #questions
Inserting into DB with prisma in api route
No description
2 replies
TTCTheo's Typesafe Cult
Created by cadams on 11/3/2023 in #questions
Do you manually create Zod schemas for your Prisma models?
I found myself doing this and thought there should be a better way, cause I have to make the same change in two places. I then googled "prisma zod" saw someone created this, which trys to solve this (I still yet to try it): https://github.com/CarterGrimmeisen/zod-prisma. I was also wondering if Drizzle possibly has this "one source of type truth" solution built in?
11 replies
TtRPC
Created by cadams on 11/1/2023 in #❓-help
When error in tRPC route, the error message is vauge
No description
12 replies
TtRPC
Created by cadams on 10/12/2023 in #❓-help
inferRouterOutputs ignore "complex data type" fields and only have primitive fields. Bug?
No description
1 replies
TTCTheo's Typesafe Cult
Created by cadams on 10/8/2023 in #questions
Non-primitive fields not showing on variables of type from RouterOutputs.
No description
13 replies
TTCTheo's Typesafe Cult
Created by cadams on 9/25/2023 in #questions
When to use "src/page/api/doStuff.ts" vs "src/server/api/routers/routerThatDoesStuff.ts"
No description
11 replies