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
![](https://utfs.io/f/bd2567f5-1879-4401-b929-f838d1be85d5-1nq2cb.png)
BUT you shouldn't
![](https://utfs.io/f/4ee895a0-8074-4652-a209-ce46bd781d8d-1nq2cb.png)
Anything marked @internal can and will change and ruin your day
This way is a little more future proof
![](https://utfs.io/f/03d94c22-1389-4e4c-98e6-4e5f2aeafb12-1nq2cb.png)
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