I’ve been reading the softdelete middleware exampl...
# orm-help
r
I’ve been reading the softdelete middleware example. It’s great! See https://www.prisma.io/docs/concepts/components/prisma-client/middleware/soft-delete-middleware I have a follow up question someone here may know the answer too: Would this also block a query like
prisma.user.findMany({ select: { posts: true } })
from returning a soft-delete post?
1
m
@Richard This is the point they're making in Step 3: Optionally prevent read/update of soft deleted records So the soft delete middleware implementation in step 2 doesn't affect the behavior of findMany. You'd have to implement similar middleware to change the behavior of the target methods - or just filter in the application code directly.
👍 1
n
Hi Richard 👋 As Michael mentioned, you would need to handle this behaviour in middleware explicitly. Based on the middleware snippet in the blog example, it won’t affect the behaviour of findMany of user model.
r
@Nurul Thanks for confirming. I was afraid it wouldn’t affect the user model. Thanks both of you!
🙌 1