Introduction to Relationships
What are Relationships?
Put simply, relationships in Skylark are the associations between different objects. Objects can be linked with one another in various ways, such as parent-child relationships.
Skylark supports many-to-many relationships, which means that an object can be associated with multiple other objects and vice versa. This enables you to quickly and easily create complex relationships between objects, making it a powerful and versatile tool for managing your assets and metadata.
Overview
To create or update relationships between objects, you can use the relevant create/update method for the object. The input of an object contains a relationships
field that allows you to add relationships with other objects.
Getting related objects in Skylark is done via the "parent" object, and an object's field contains a drop-down list of all related objects.
Skylark provides two ways to link objects to each other -
- Create - Create a new child object and link it to the parent
- Link - Link the parent to a preexisting child object
If you need to remove relationships between objects, you can use the unlink option.
It's possible to mix and match relationship mutations in Skylark. For example, you could create, link, and unlink objects in a single request.
When you delete an object in Skylark, all its relationships with other objects are deleted as well. The deleteObject
mutation includes a return field called removed_relationships
, which lists all the objects related to the deleted object.
Updated 6 months ago