Hi this is a doubt with respect to relations in my...
# prisma-client
u
Hi this is a doubt with respect to relations in my prisma schema. It is between User type and friend type
type User {
  
id: ID! @id
  
name: String!
  
username: String! @unique
Copy code
}
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.