Not sure if it's a bug or something that's just impossible,
or I'm doing something wrong.
I'd like to create a N:M relation based on a tables' content. I've used [these docs](
https://www.prisma.io/docs/datamodel-and-migrations/datamodel-MYSQL-knul/#relation-table) that shows how to use @relationTable
User 1:N Item
- User has n Items
- Item has 1 Owner
Item 1:n Product
- Item can be 1 product
- Product can be n Items
Product N:M Owners
- Product
can have owners over Item.product and Item.owner
- Owners
can have Products (if a Product is linked) over Item.owner and Item.product
I tried to make this happen, but it doesn't seem to work.
Am I doing something wrong here or is this not supported?
graphql
type User {
id: ID! @id
items: [Item!]! @relation(name: "OwnerRelation")
}
type Item @relationTable {
id: ID! @id
owner: User! @relation(link: INLINE, name: "OwnerRelation")
product: Product @relation(link: INLINE, name: "ItemProductRelation")
}
type Product {
id: ID! @id
items: [Item!]! @relation(name: "ItemProductRelation")
# this N:M from Product > Item.product - Item.owner > User doesn't work
owners: [User!]! @relation(link: TABLE, name: "Item")
}