Is there a way to have ts types and v.whatever() types synced?
hey, its getting rather tedious to update my types on so many places. Does anyone know of a more elegant approach?
1. how can I keep both typescript and schema updated at the same time?
eg
}
2. if i have 3 different mutations that take a todo as args... how do I prevent having to change the args todo definition on all 3 manualy?
2 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
SOLUTION:
make new file validators.ts in convex folder and define your validators there, then infer the type
the type can also be used in frontend magicaly 👍
the validator can be used while defining schemas