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
if we get data directly from the model itself db.product.findMany(), it does omit deleted field. But, if we get the data thru include e.g, db.category.findFirst({include: {products: true}}), it doesn't omit the deleted field.
expected behavior
my expectation was to also exclude the field when using relationships.
schema example (simplified):
model Product {
id String @id @default(cuid())
category Category @relation(fields: [categoryId], references: [id])
categoryId String
deleted Int @default(0) @omit
@@deny('read', deleted != 0)
}
model Category {
products Product[]
}
Screenshots
Environment (please complete the following information):
ZenStack version: [1.8.1]
Prisma version: [5.7.1]
Database type: [SQLite]
Additional context
The text was updated successfully, but these errors were encountered:
Description and expected behavior
Background:
I'm following this article: https://zenstack.dev/blog/soft-delete-real to implement soft-delete
Problem
if we get data directly from the model itself
db.product.findMany()
, it does omitdeleted
field. But, if we get the data thruinclude
e.g,db.category.findFirst({include: {products: true}})
, it doesn't omit thedeleted
field.expected behavior
my expectation was to also exclude the field when using relationships.
schema example (simplified):
Screenshots

Environment (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: