Nick
Nick
TtRPC
Created by Johny on 5/31/2025 in #❓-help
Zod Output validation failed
Only if the type is correct for your data, and potentially only if strict is on
5 replies
TtRPC
Created by Johny on 5/31/2025 in #❓-help
Zod Output validation failed
Because your data and type are not the same I’d guess, it’s Zod’s job to check this
5 replies
TtRPC
Created by traches on 5/29/2025 in #❓-help
Can I extend the procedure builder?
you can define a base procedure with authorization for "thing" baked in and then use that for various procedures with extra input data. Inputs and Ctx can both be extended and merged over multiple layers
9 replies
TtRPC
Created by traches on 5/29/2025 in #❓-help
Can I extend the procedure builder?
No description
9 replies
TtRPC
Created by traches on 5/29/2025 in #❓-help
Can I extend the procedure builder?
Got it
9 replies
TtRPC
Created by suhanw on 5/29/2025 in #❓-help
RBAC with tRPC
you could integrate any RBAC library in with a bit of glue for the middleware
4 replies
TtRPC
Created by suhanw on 5/29/2025 in #❓-help
RBAC with tRPC
I've always rolled my own, just left an answer to RBAC here: https://discord.com/channels/867764511159091230/1377625055109976204
4 replies
TtRPC
Created by traches on 5/29/2025 in #❓-help
Can I extend the procedure builder?
This is all pretty normal stuff. The ingredients are indeed a middleware, context, and meta Middlewares can access inputs but there isn't much reason to since auth details should be in headers/cookies. Importantly they can gate access to procedures by throwing unauthorised errors (etc) createContext()/Context is the best way to extract some bits from headers in a type-safe way, and middlewares can access this state type safely Meta is great to allow procedures to be configured, like assigning an entitlement key to a procedure which the middleware can then check against the user, again in a type safe way
9 replies
TtRPC
Created by DevPanda on 5/26/2025 in #❓-help
Multiple .meta in one route
test is the name of the procedure in this case
7 replies
TtRPC
Created by DevPanda on 5/26/2025 in #❓-help
Multiple .meta in one route
You can't chain anything on top of query, that creates the procedure
7 replies
TtRPC
Created by DevPanda on 5/26/2025 in #❓-help
Multiple .meta in one route
Maybe you could share some more details?
7 replies
TtRPC
Created by DevPanda on 5/26/2025 in #❓-help
Multiple .meta in one route
If you call .meta() multiple times the results will get merged if that's what you mean?
7 replies
TtRPC
Created by typedef on 5/25/2025 in #❓-help
Upgrading from v10 to v11
This implies you've got mixed tRPC versions perhaps?
6 replies
TtRPC
Created by typedef on 5/25/2025 in #❓-help
Upgrading from v10 to v11
6 replies
TtRPC
Created by Simon on 5/9/2025 in #❓-help
Throw Validation error inside the procedure?
You’ll want an errorFormatter and to handle the error globally there
3 replies
TtRPC
Created by pes04 on 5/8/2025 in #❓-help
Question about onError and modifying error messages in tRPC
PRs welcome! I’m surprised onError said “change” that’s definitely wrong
7 replies
TtRPC
Created by pes04 on 5/8/2025 in #❓-help
Question about onError and modifying error messages in tRPC
You want the errorFormatter
7 replies
TtRPC
Created by 00000 on 4/23/2025 in #❓-help
how can I set up trpc to work with nested providers?
The recommended approach would be SOA which we have an example for: https://github.com/trpc/trpc/tree/main/examples/soa
4 replies
TtRPC
Created by Peform on 5/3/2025 in #❓-help
trpc caching procedure calls for queries in the same batch
Just roll something so you store the first promise and return it to all other callers
9 replies
TtRPC
Created by Peform on 5/3/2025 in #❓-help
trpc caching procedure calls for queries in the same batch
I would put a cache in createContext and then have a middleware call it. That way the middleware instances rely on the same promise for each batch
9 replies