UddhavNavneeth
11/08/2020, 8:03 AMtype User {
id: ID! @id
name: String!
username: String! @unique
}
type Friend {
id: ID! @id
user1: User! @relation(name: "FriendToUser1", onDelete: SET_NULL)
user2: User! @relation(name: "FriendToUser2", onDelete: SET_NULL)
status: Int!
}
How do set this up properly, I want to set up a field called Friends in the type User which is linked to type Friend and which Cascades onDelete. Main issue is the fact that Friend has 2 users in it because of which I am unable to set up a direct relation. Due to the current scenario I'm not being able to delete Users also as relation would get violated. Please give me recommendations.