How can I make 2 users (User1 and User2) friends?

Suppose we have created two users in Hypi with the id 1 and 2. Now I want to set user 1 as a friend with user 2. How can I achieve it?

User Schema:

type User {
user: Account!
followedBy: [User!]
friends: [User!]
following: [User!]
groups: [UserGroup!]
}

You can link objects in Hypi by including hypi.id for example.
If you have User with ids 1 and 2 and you want user 2 to be a friend of user 1 then you can upsert something like this:

mutation { upsert(values: {User: [
   {
     hypi: {id:"1"},
     friends: [
       {hypi:{id: 2}}
     ]
   }
  ]})
}

By passing an object in the friendsarray with a hypi.id the platform will link friend 2 via the friends field to User 1. You can also link and unlink by explicitly calling these functions in the API, see https://docs.hypi.app/tutorials/graph