Hohai ! Just to be sure, can anyone confirm that t...
# orm-help
w
Hohai ! Just to be sure, can anyone confirm that there are no ways as of now to perform soft delete ? 😣
n
what is soft delete?
w
Soft deletion = ā€œarchivingā€. Which means you only set the
deletedAt
of a row, and then you filter it when querying your database.
n
1) yes, there is no build in soft deletion support (see https://github.com/prismagraphql/prisma/issues/1816) 2) it should be quite straightforward to add a boolean
deleted
and/or datetime
deletedAt
to your datamodel, expose a
deleteX
mutation in your application schema and implement the resolver as
updateX(where: { id: "" } data: { deleted: true, deletedAt: new Date().toISOString() }
.
w
That’s exactly what I’ve ended up doing, thanks nilan!
šŸ‘ 1