Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Support for updating a field to NULL #17

@loukotal

Description

@loukotal

Databless version: 4.0.0-beta.11

AFAIK, currently there is not type support for nullable fields. If I want to update field to NULL, I need to do null as any, because field types are <field type> | undefined.

So trying to

await userRepository.update({id: user.id}, {
  name: null,
}

throws an error

Type 'string | null | undefined' is not assignable to type 'string | undefined'.
Type 'null' is not assignable to type 'string | undefined'.

Would be cool to be able to set null without the as any.

Thanks! 🙇

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions