-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow soft-deletion ? #6
Comments
I came across this issue while searching for soft-delete for On the Currently when I delete a single item from an Edit page, or bulk delete multiple items from the List page, those items are optimistically removed from the List page, and a new query is made to refresh the results. In the normal case this would usually pull in X items from the next page, but in the soft-delete case the recently deleted items reappear. Would it make sense to add a flag to the list view to not optimistically remove deleted items? I think this would be needed by any DataProvider wishing to support soft-delete. |
In prisma-ecommerce, I have several models that I need to be soft-deleted only, such as
Product
s so thatOrder
s remains intact.I see two ways of achieving this:
Either we add another mutation type
PRISMA_SOFT_DELETE
(along with the presentPRISMA_CONNECT
,PRISMA_CREATE
etc..), and behave accordinglyOr we look for a special field in models (eg:
deletedAt
), and always soft-delete those fields.Note: we will have to filter all subsequent queries to remove soft-deleted nodes.
(
where: { deletedAt: null }
Any feedback would be much appreciated.
The text was updated successfully, but these errors were encountered: