Skip to main content
Documentation

Graph Operations

Analyzing and modifying the project graph is the main purpose of most intelligent functions.

Traversing the graph

Links can be traversed in both directions, forward and backward.
EntityEntityEntityEntityEntityEntityEntityEntityEntityEntityEntityProjectEntity(root)
Traverse forward
var targetEntities = sourceEntity.traverse("linkId");

Traverse backward
var sourceEntities = targetEntity.traverseBack("linkId");

Linking entities

Linking two entities
sourceEntity.link("linkId", targetEntity);

Unlinking entities

Unlinking two entities
sourceEntity.unlink("linkId", targetEntity);

Adding linked entities

New entities are usually added and linked to an existing entity in a single step.
Adding linked entities
var newEntities = sourceEntity.addLinked("linkId");

// with specific entity id
newEntities = sourceEntity.addLinked("linkId", "entityId");

What next?