Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An entity field must be set to null in order to be unset, yet model definitions don't allow it #435

Open
Lezek123 opened this issue Jun 25, 2021 · 1 comment
Assignees

Comments

@Lezek123
Copy link
Contributor

Lezek123 commented Jun 25, 2021

It looks like the neither setting a field to undefined nor using delete entity.field actually unsets the value in the database.
See: typeorm/typeorm#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;
}
@Lezek123
Copy link
Contributor Author

Turns out this may be tricky to fix: typeorm/typeorm#5454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants