Paul T
06/28/2021, 9:13 PMconst events = await prisma.event.findMany()
await Promise.all(events.map(async e) => {
const performers = await prisma.performer.findMany({ where: ..logicToFindPerformers });
await prisma.event.update(
{
where: { id: e.id },
data: { performers: performers.map((p) => ({ id: p.id })) }
}
)
})
But I am getting this error message from the client:
Unknown arg 'performers' in data.performers for type EventUncheckedUpdateInput.
I can see from my generated schema that I do have a join table created (_EventToPerformer
), so what is the correct way to join existing records in a many to many relationship?Ryan
06/29/2021, 4:56 AMPaul T
06/29/2021, 4:22 PM