Skip to content

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

Closed
@ymc9

Description

@ymc9
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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions