Answer
Ove
rf
low
Answer Overflow Logo
GitHub
Get Started
Login
GitHub
Open popover
T
tRPC
❓-help
Join Server
How to ignore `input` validation and just pass in an object with interfaces?
L
lukutis
View on Discord
3/15/2023
For my input I just want to pass in an interface rather than using a Zod schema. Either that or if somebody can let me know how to pass in an external interface as a
z.object()
param
N
nlucas
View on Discord
3/15/2023
Could you make a GitHub issue for this? It’s an interesting idea and one I don’t believe is possible without weird hacks for now
N
nlucas
View on Discord
3/15/2023
undefined as any as ZodType<YourType>
N
nlucas
View on Discord
3/15/2023
^ this might work but I doubt it
L
lukutis
View on Discord
3/16/2023
Sure thing!
UU
Unknown User
View on Discord
3/16/2023
Message Not Public
Sign In & Join Server To View
N
nlucas
View on Discord
3/16/2023
Good idea, can turn that into a simple util too, something like: const t<T> = v => v as T
N
nlucas
View on Discord
3/16/2023
It’s not particularly type-safe but tRPC could definitely offer a 1st class approach