Skip to content

createMany field should be excluded from nested create payload for polymorphic models #1577

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 Jul 12, 2024 · 0 comments
Milestone

Comments

@ymc9
Copy link
Member

ymc9 commented Jul 12, 2024

model Profile {
  id Int @id
  name String
  items Item[]
  type String
  @@delegate(type)
}

model GoldProfile extends Profile {
  ticket Int
}

model Item {
  id Int @id
  profileId Int
  profile Profile @relation(fields: [profileId], references: [id])
  type String
  @@delegate(type)
}

model GoldItem extends Item {
  inventory Boolean
}
await db.goldProfile.create({
    data: {
      id: 5,
      ticket: 123,
      name: "hello",
      items: {
        createMany: {
          data: [
            {
              // HERE I AM TOLD BY VSCODE THAT I MUST PROVIDE: id, profileId and type
            }
          ]
        }
      }
    }

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant