Hello everybody, Is there a method to soft delete?...
# orm-help
r
Hello everybody, Is there a method to soft delete? Thanks
h
you'd have to manually implement that
r
Thanks @harmony Are there any examples for that? I am using the Prisma Api
Do you mean creating a backup type and inserting replica node to it before deleting?
h
adding a deleted field to the type
n
A simple boolean field could be all you need 🙂
r
Thanks @nilan All my types contain deleted_at field. So just update that field would be the best practice for now?
n
both look like they get the job done :)
r
Great!!
t
if you’re using Apollo, it has some trouble passing
null
value if not in a parameter, so it might be less bug prone/easier to code with
deleted: bool
and
deletedAt: DateTime
and then just check the
bool
field in your get calls and
deletedAt
if/when you need the timestamp