lukas
lukas16mo ago

How to ignore `input` validation and just pass in an object with interfaces?

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
4 Replies
Nick
Nick16mo ago
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 undefined as any as ZodType<YourType> ^ this might work but I doubt it
lukas
lukas16mo ago
Sure thing!
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Nick
Nick16mo ago
Good idea, can turn that into a simple util too, something like: const t<T> = v => v as T It’s not particularly type-safe but tRPC could definitely offer a 1st class approach