Title
r

Raviv

04/12/2018, 2:57 PM
Hello everybody, Is there a method to soft delete? Thanks
h

harmony

04/12/2018, 2:58 PM
you'd have to manually implement that
r

Raviv

04/12/2018, 3:00 PM
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

harmony

04/12/2018, 3:02 PM
adding a deleted field to the type
n

nilan

04/12/2018, 3:02 PM
A simple boolean field could be all you need 🙂
r

Raviv

04/12/2018, 3:03 PM
Thanks @nilan All my types contain deleted_at field. So just update that field would be the best practice for now?
n

nilan

04/12/2018, 3:05 PM
both look like they get the job done :)
r

Raviv

04/12/2018, 3:05 PM
Great!!
t

tsdexter

04/12/2018, 5:04 PM
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