Benjamin Kroeger
07/16/2021, 11:19 AMexport type ModelWhereUniqueInput = {
id?: string
}
Benjamin Kroeger
07/17/2021, 7:47 PMRyan
07/19/2021, 5:52 AMBenjamin Kroeger
07/19/2021, 10:28 AMid
) - so I was wondering if there was a check for that case - and one could automatically make that field required then.
I suppose the more granular type definition would be a union of types that have exactly one of the model's unique props each and make it required.
model User {
id String @id
email String @unique
}
type UserWhereUniqueInput = { id: string } | { email: string }
Benjamin Kroeger
07/19/2021, 10:35 AM