Unlink Objects
The unlink
option allows you to remove relationships.
In the “parent” input object (whether in a createObject
or updateObject
mutation) A relationships field should be available where the object has relationships defined to other objects. This object will include an unlink
argument which defines a list of objects to remove relationships.
The body of the unlink field can be either a single UID or External ID or an array of UIDs or external IDs (or a mix of both) 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 External ID>", "<another episode UID>"]
}
}
}
)
{
uid
episodes {
uid
}
}
}
Updated 5 months ago