tltl
tltl2y ago

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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Nick
Nick2y ago
A procedure is technically just a function, so if you really want to you could
Nick
Nick2y ago
BUT you shouldn't
Nick
Nick2y ago
Nick
Nick2y ago
Anything marked @internal can and will change and ruin your day
Nick
Nick2y ago
This way is a little more future proof
Nick
Nick2y ago
But at that point, just grab your router and call via that instead
tltl
tltl2y ago
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
trash
trash2y ago
@julius don’t you have an article with visuals on something like this? was trying to find it but maybe i’m mistaken
trash
trash2y ago
yup @ostoto this can be helpful to you