Unlink Objects

The unlink option allows you to remove relationships.

In the “parent” input object (whether in a createObject or updateObject mutation) where the object has relationships defined to other objects, a relationships field should be available. This object will include a list of objects that relationships can be unlinked from, and within the relationship input the unlink input allows you to remove relationships.

The body of the unlink field can be either a single string or an array of strings to link multiple objects.

Unlink Single Object

mutation updateSeason {
  updateSeason(uid: "<season UID>", season: {
      relationships: {
        episodes: {
          unlink: "<episode UID>"
        }
      }
    }
  ) 
  {
    uid
    episodes {
      uid
    }
  }
}

Unlink Multiple Objects

mutation updateSeason {
  updateSeason(uid: "<season UID>", season: {
      relationships: {
        episodes: {
          unlink: ["<episode UID>", "<another episode UID>"]
        }
      }
    }
  ) 
  {
    uid
    episodes {
      uid
    }
  }
}