7 Replies
you know what would be even better
make a reusable function instead
Yeah I guess that would be possible. However, is nice to have all of the trpc context managed by default, rather than setting up a helper function that I need to pass session, prisma, etc. to while making sure everything is typesafe.
i dont see how it wouldnt be typesafe if you just setup the input types and output types right
Yeee I understand that -- but everything is implicitly typesafe when going through trpc routers whereas I have to explicitly write out types when creating helper functions. This is just me being nitpicky, but I was wondering if there's an easy way to call procedures from within other procedures. If not I can make helper functions
Server Side Calls | tRPC
You may need to call your procedure(s) directly from the server, createCaller() function returns you an instance of RouterCaller able to execute queries and mutations.
^
cool thank you!