Hi i was trying to do something like this in my US...
# orm-help
s
Hi i was trying to do something like this in my USER. In order to achieve some sort of friend request process but i was getting an error as shown below the data model. Please help me out on this type USER { friends: [User!]! @scalarList(strategy: RELATION) sent: [User!]! @scalarList(strategy: RELATION) received: [User!]! @scalarList(strategy: RELATION) } Error: User ✖️ The relation field
friends
must specify a
@relation
directive:
@relation(name: "MyRelation")
✖️ The relation field
sent
must specify a
@relation
directive:
@relation(name: "MyRelation")
✖️ The relation field
received
must specify a
@relation
directive:
@relation(name: "MyRelation")
r
Hey @saketh kumar 👋 Could you try giving names to your relations, something like this:
Copy code
type USER {
  friends: [User!]! @scalarList(strategy: RELATION) @relation(name: "relation")
}
s
i have tried using something like this it works out @relation(name: "Friends") @relation(name: "SENT") @relation(name: "RECEIVED") thanks for reply will try the way you mentioned
💯 1