Zyon
02/04/2019, 6:01 PMnuno
02/04/2019, 6:33 PMtype A {
id: ID! @unique
as: [B!]!
}
type B {
id: ID! @unique
bs: [A!]!
}
Does something like this work for you?Zyon
02/04/2019, 6:51 PMtype A {
id: ID! @unique
as: [B!]! @relation(link: INLINE)
}
type B {
id: ID! @unique
bs: [A!]!
}
So i just want to confirm that Prisma will handle cascading updates on both sides of the many-many relationship? Therefore, does it matter which side I put the directive on?
as: [B!]! @relation(link: INLINE)
OR
bs: [A!]! @relation(link: INLINE)nuno
02/04/2019, 6:56 PMnuno
02/04/2019, 6:57 PMZyon
02/04/2019, 7:09 PM@relation(link: INLINE) i get these errors when trying to deploy. But like you said, it sounds like a datamodel v2 issue. So is there no way to handle many-many relationships in v2?
A
✖️ The field B must provide a relation link mode. Either specify it on this field or the opposite field. Valid values are: @relation(link: INLINE)
B
✖️ The field A must provide a relation link mode. Either specify it on this field or the opposite field. Valid values are: @relation(link: INLINE)nuno
02/04/2019, 7:54 PMtype A {
id: ID! @unique
as: [B!]! @relation(name: "some_relation")
}
type B {
id: ID! @unique
bs: [A!]! @relation(name: "some_relation")
}Zyon
02/04/2019, 7:56 PMtype Message {
id: ID! @id
comments: [messageComment!]! @relation(name: "CommentMessages")
createdDate: DateTime @createdAt
}
type messageComment {
id: ID! @id
messages: [Message!]! @relation(name: "CommentMessages")
createdDate: DateTime @createdAt
}Zyon
02/04/2019, 7:56 PMZyon
02/04/2019, 7:56 PMmessageComment to Message and are only providing a relation directive with a name on messageComment. Plea
se also provide the same named relation directive on the relation field on Message pointing towards messageComment.nuno
02/04/2019, 8:00 PMZyon
02/04/2019, 11:45 PMZyon
02/05/2019, 10:07 AM