Arpit Satyal
08/17/2022, 2:17 PMDave Rupert
08/17/2022, 2:50 PMauthorId
is not setup as a unique field, so multiple patients could have the same authorId
and that’s why you can’t update off of it. The only uniques you have in Patient
right now are id
and email
.Raphael Etim
08/17/2022, 3:04 PMid
and email
.
type PatientWhereUniqueInput {
id?: Int
email?: String
}
but to able to perform the update on any of the field, you can use updateMany
. For example:
const updatedPatient = await prisma.patient.updateMany({
where: {
authorId: 1 ,
},
data: {
firstName: 'William'
},
});
Also you can find a similar issue where this was discussed hereArpit Satyal
08/17/2022, 3:06 PMRaphael Etim
08/17/2022, 3:07 PM