Common Errors and Resolutions - SeedCompany/cord-docs GitHub Wiki
Common errors and their resolutions when working with Edge + Neo4j migration
Issues with Dates not being nullable
Here's a detailed convo from Carson about Dates and how the nullability can throw certain TS errors. Note This is a specific example about Ceremony, but this same issue has crept up on many resources.
Finally TS tells us the error is
Types of property estimatedDate are incompatible. Type CalendarDate | null is not assignable to type CalendarDate
This is another long-standing inconsistency we've had.
We declare readonly estimatedDate: SecuredDate; which is just a secure wrapped value of CalendarDate
.
But the EdgeDB schema we've recently declared is optional
(implicit) estimatedDate: cal::local_date; aka nullable.
The neo4j queries don't have strict types nor another schema to compare against, which is why this has lived so long. Now it actually matters as EdgeDB is forcing us to be accurate here.
We need to fix the fields in the DTO to be SecuredDateNullable
which translates to a secure wrapped value of CalendarDate | null
.