tRPCttRPC
Powered by
medv ❄M
tRPC•3y ago•
4 replies
medv ❄

procedure.input(z.object) is inferred as a partial (optional fields)?

Have a strange case of my input types coming through as partial in procedures, cannot replicate in trpc.io sandbox, any ideas why this might be happening? If I make it a simple
input(z.string())
input(z.string())
it is of type
string
string
, but
z.object()
z.object()
properties come through as optional:
image.png
Solution
Found the answer, this is an issue with tsconfig missing
strict: true
strict: true
. Mine was set to strict, but apparently my nx integrated repo was not parsing the chain of extended configs correctly, so this small issue was just a symptom of a larger one. Zod just validated my environment 🤔
Jump to solution
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Procedure return types are getting inferred as any
KrangaKKranga / ❓-help
3y ago
z.map() as an input
VengeanceVVengeance / ❓-help
4y ago
procedure input context
MugetsuMMugetsu / ❓-help
4y ago
Procedure with generic input?
hagabakaHhagabaka / ❓-help
3y ago