How to return value for many to many relation, ```...
# orm-help
s
How to return value for many to many relation,
Copy code
model Post {
  id         Int                 @id @default(autoincrement())
  title      String
  categories CategoriesOnPosts[]
}

model Category {
  id    Int                 @id @default(autoincrement())
  name  String
  posts CategoriesOnPosts[]
}

model CategoriesOnPosts {
  post       Post     @relation(fields: [postId], references: [id])
  postId     Int
  category   Category @relation(fields: [categoryId], references: [id])
  categoryId Int
  assignedAt DateTime @default(now())
  assignedBy String

  @@id([postId, categoryId])
}
Typescript is giving me an error when I try the following,
Copy code
jest.spyOn(<http://prisma.post|prisma.post>, 'findFirst').mockResolvedValue({
    ...mockPost,
    categories: [...mockCategories],
});