tRPCttRPC
Powered by
K1|llerK
tRPC•3y ago
K1|ller

what's this union type doing(Zod)?

I have 2 types of user, guest and registered(schemas). I have a union type with both and the guest doesn't include the "admin" field.
I expect Zod to pick one of the 2 schemas but when I do user.admin it just doesn't exist.
What is this union doing then?? I'm very confused.
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Generic Zod as Input Type
RealityShiftRRealityShift / ❓-help
3y ago
What's the type of errorFormatter parameter
AezralAAezral / ❓-help
3y ago
zod input validation from ts type
intiserxIintiserx / ❓-help
3y ago