maoosi / prisma-appsync

⚡ Turns your ◭ Prisma Schema into a fully-featured GraphQL API, tailored for AWS AppSync.

Home Page:https://prisma-appsync.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

StephanDecker opened this issue · 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.

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