How to call TRPC procedures directly, without creating a router and calling createCaller?
I'd like to use a TRPC procedure by calling it directly like
someProcedure({input, ctx})
We frequently call TRPC procedures from within other TRPC procedures.11 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
A procedure is technically just a function, so if you really want to you could
BUT you shouldn't
Anything marked @internal can and will change and ruin your day
This way is a little more future proof
But at that point, just grab your router and call via that instead
gotcha, thanks! ideal interface for me might look like
p.createCaller(ctx)(input)
i dont want to have to create a router and then call the same method name on the router@julius don’t you have an article with visuals on something like this?
was trying to find it but maybe i’m mistaken
https://trpc.io/docs/server-side-calls the diagram there?
yup @ostoto this can be helpful to you