Can I call tRPC procedure inside another procedure?
Something like this:
Solution:Jump to solution
Server Side Calls | tRPC
You may need to call your procedure(s) directly from the same server they're hosted in, router.createCaller() can be used to achieve this.
3 Replies
Solution
Server Side Calls | tRPC
You may need to call your procedure(s) directly from the same server they're hosted in, router.createCaller() can be used to achieve this.
what you probably want to do is extract the shared logic to a function you can call from both procedures
Christopher Ehrlich
YouTube
Advanced tRPC - Callers, functions, and gSSP
🚨 createSSGHelpers has been renamed to createServerSideHelpers 🚨
Repo for this video: https://github.com/c-ehrlich/you-dont-need-callers
If you want to use schema in the frontend, they cannot be imported from the same file as things that run specifically in the backend. One solution would be to put them into a
procedureName.schema.ts
or simi...