Skip to content

Zod plugin's "strip" mode causes create payload fields to be accidentally dropped #1746

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

Closed
ymc9 opened this issue Sep 27, 2024 · 0 comments
Closed

Comments

@ymc9
Copy link
Member

ymc9 commented Sep 27, 2024

plugin zod {
  provider = '@core/zod'
  mode = 'strip'
  preserveTsFiles = true
}

model Submission {
  id       String    @id @default(uuid())
  title    String?
  userId   String?
  user     User?     @relation(fields: [userId], references: [id], name: "user")
  comments Comment[] @relation("submission")
  @@allow("all", true)
}

model User {
  id          String       @id @default(uuid())
  name        String?
  submissions Submission[] @relation("user")
  comments    Comment[]    @relation("user")
  @@allow("all", true)
}

model Comment {
  id           String     @id @default(uuid())
  content      String?
  userId       String
  user         User       @relation(fields: [userId], references: [id], name: "user")
  submissionId String
  submission   Submission @relation(fields: [submissionId], references: [id], name: "submission")
  @@allow("all", true)
}
{
    data: {
        content: 'Comment',
        userId: '1',
        submissionId: '2'
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant