Modifying input in a middleware
Is it possible to modify input somewhere so that I can do something like this
as just
6 Replies
sorry, what are you trying to do?
.transform()
should worki originally had .transform but I can't do that cause I don't have access to context
aha, you want access to context in middleware the input
that's not possible unfortunately, but you can do a reusable part of it
Alex / KATT 🐱 (@alexdotjs) on X
Middlewares in tRPC 📗
Base procedures
Most apps should only have a few base procedures that cover 99% of the app's use cases -
In the below example, I have:
1. A public base procedure with logging
2. An authed base procedure that extends ^
3. An organization procedure that
X
Solution
so a procedure with custom context is the best option?
i was either thinking that or a wrapper function would do it