Docs
Join the conversation
Join Slack
Channels
graphql-nexus
job-board
madewithprisma
mongodb
new-channel
new-channel
new-channel
new-channel
new-channel
orm-help
prisma-client
prisma-data-platform
prisma-go-community
prisma-in-production
prisma-jobs
prisma-migrate
prisma-studio
prisma-whats-new
prisma1-community
prismaday
prismaserverless
product-wishlist
random
Powered by Linen
Channels
graphql-nexus
job-board
madewithprisma
mongodb
new-channel
new-channel
new-channel
new-channel
new-channel
orm-help
prisma-client
prisma-data-platform
prisma-go-community
prisma-in-production
prisma-jobs
prisma-migrate
prisma-studio
prisma-whats-new
prisma1-community
prismaday
prismaserverless
product-wishlist
random
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