The error occurs because prisma tries to use connectOrCreate
with a unique constraint on the Information
model, which includes userId
, name
, surname
, phone_number
, and email
. Since userId
is also unique, prisma expects these fields to be defined to either connect to or create the Information record. If any field is undefined
, prisma will fail because undefined
is not a valid value for database fields. However, userId
can be null
.