Get procedure path programatically?
Is it possible to get the path the procedure was called by programatically?
I don't think it's possible to use anything like ctx.req.url when batching is enabled.
8 Replies
in what context do you need to do it? on the frontend?
no, on the backend, i want to use the path for tracing
here's an example as a middleware: https://trpc.io/docs/server/middlewares#logging
opts.path, yeah from testing stuff out i found that to exist but its not typed for some reason

it's available in middlewares, but apparently not in the resolver options
but the value itself is there indeed
huh
that's weird
i think i will resort to just manually checking if the value is there and the typeof...
thank you
should be fairly easy to add it in the lib
added in 11.5.0