Modifying the type of mutateAsync's
I'm doing an optimistic update when adding an entry to a table and calling
Specifically, I have this:
I tried explicitly setting the type like this:
...but that gives me a new error, ultimately saying
So for now, I just explicitly set all the optional variables to
mutateAsync with partial data for that entry. However, the type for the variables of the mutateAsync function seem to be the same as each element in my useQuery result, and this gives me a type error, because I'm leaving out a bunch of fields that the database will eventually default to.Specifically, I have this:
DataExport requires certain keys, but if I leave those out, Drizzle will set defaults, so I want variables to be of DataExportInsert instead.I tried explicitly setting the type like this:
...but that gives me a new error, ultimately saying
Types of parameters variables and variables are incompatible..So for now, I just explicitly set all the optional variables to
null like Drizzle will end up doing, but I wonder if there's a better way to set the type.