You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across this issue while searching for soft-delete for ra-data-graphql. I don't want to hijack this issue, but think there might be some overlap here.
On the ra-data-graphql side of things causing the soft-delete to happen is easy since we are in control of the Mutation being called, but I suspect there may be a change needed in the core to support this.
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: