Son
Son3mo ago

son_ayo's Thread

are there any opinions on how to verison your api?
5 Replies
convex-threads
convex-threads3mo ago
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. If this is a support-related question, please create a post in #support-community. If not, carry on! Thanks!
Indy
Indy3mo ago
One simple answer: always use returns validator and args validators, and never remove fields. Only add or expand options (like making fields unions or optional).
Son
SonOP3mo ago
Thanks for the tips Is it a good to approach to make all fields in your database scheme optional?
Indy
Indy3mo ago
Database schemas have different best practices than functions/apis. Because you have full control over the database (vs. who calls your functions), ideally, you should try to have the most restrictive schema possible. This will prevent you from having code that checks if the field exists everywhere. You can always run migrations over your data to clean it up to a good place: https://www.convex.dev/components/migrations
Convex
Migrations
Framework for long running data migrations of live data.
Son
SonOP3mo ago
Thanks again!

Did you find this page helpful?