How to remove Link in a Many-to-Many Relationship

I have a Many-to-Many Relationship between objects.

type Segments{
  leads: [Contact] @hasInverse(field: segments)
}
type Contact {
  segments: [Segments]
}

I want to remove the link between the objects of FilterResult and Contact.
I’m using this mutation to do so,

mutation updateSegments($patch: UpdateSegmentsInput!) {
            updateSegments(input: $patch){
                segments{
                    id
                }
            }
        }

The variables are as follows:-

{
   "patch": {
      "filter": {
          "id": ["0x4e23"]
       },
       "set": {
            "leads":[]
       }
    }
 }

But it’s not working. How can i reset the link?

1 Like

The UpdateSegmentsInput type will have a remove field. Have you tried that?