Theo's Typesafe CultTTC
Theo's Typesafe Cult4y ago
8 replies
AvPirate

Prisma - creating row with empty array fields

Hi, I have a user table in which I have a reference field of the Story table, written like this:
story Story[]

When I create a new user, since this field cannot be optional in prisma, I write it like this:
return await prisma.story.create({ data: { ... story: [], }, });

I get this error: got invalid value [] on prisma.createOneStory. Provided List<>
Was this page helpful?