prisma-appsync icon indicating copy to clipboard operation
prisma-appsync copied to clipboard

Delete operation: Argument `where` of type [Model]WhereUniqueInput needs at least one of `id` arguments.

Open StephanDecker opened this issue 2 years ago • 1 comments

Let's say we have this model.

model Example {
    id   String @id @default(uuid())
    name String
}

When looking at the delete operation the generated input ExampleExtendedWhereUniqueInput is not correct.

input ExampleExtendedWhereUniqueInput {
    OR: [ExampleWhereInput!]
    NOT: [ExampleWhereInput!]
    AND: [ExampleWhereInput!]
    id: String
    name: StringFilter
}

id: String should be mandatory: id: String! That should only be the case when not using the @unique or @@unique directive because in that case we could also use the unique field(s) in order to specify a unique row.

StephanDecker avatar Jan 12 '24 10:01 StephanDecker

Yes, you are correct! Thanks for reporting the issue, I will fix it soon!

maoosi avatar Jan 14 '24 01:01 maoosi