hydra
hydra copied to clipboard
An entity field must be set to null in order to be unset, yet model definitions don't allow it
It looks like the neither setting a field to undefined
nor using delete entity.field
actually unsets the value in the database.
See: https://github.com/typeorm/typeorm/issues/2934
This conflicts with the TypeScript definitions of models generated by Hydra (warthog?), since they don't allow null
as value even for optional fields.
For example:
export declare class MemberMetadata extends BaseModel {
name?: string;
avatar?: DataObject;
about?: string;
}
Turns out this may be tricky to fix: https://github.com/typeorm/typeorm/issues/5454