Jaye
08/19/2021, 9:02 AMWorkflow
that looks like this:
model Workflow {
id:
id String @id @default(cuid())
// ...
previousReview Workflow? @relation("WorkflowToWorkflow", fields: [workflowId], references: [id])
nextReview Workflow[] @relation("WorkflowToWorkflow")
workflowId String?
}
they can form links in a chain, each one pointing at the next one using the workflowId
column.
when i make a query like this:
const workflow = await prisma.workflow.findUnique({
where: {
id
},
includes: {
previousReview: true,
nextReview: true,
}
})
i can get the previous review fine, but the next review always seems to come out as null, even when it does exist
what am i doing wrong?Ryan
08/19/2021, 9:26 AM