-
Notifications
You must be signed in to change notification settings - Fork 458
Description
Hello,
I'm new to Convex, so maybe I'm missing something, but so far I can't find it. I created a super tiny application, a CRUD for a table that just stores some numbers, that's it. This application ended up having a lot of boilerplate, with the structure of the data having to be defined 4 times, which feels very error prone.
One of the problems was that Convex demands nulls to represent blank fields in the API, and undefined to represent blank fields when calling db.patch, so there's a need to convert between these representations. This could be fixed by either db.patch accepting nulls or the API accepting (and not silently dropping) undefineds.
You can see the little app here: https://github.com/pupeno/convex-nextjs-playground
The reason there are 4 representations of the shape of the data is because there's an extra one for the schema, and another one for the form, because the forms, at least in React Hook Form, use "" to represent blank. I don't believe Convex can contribute in any way to this.