Skip to main content

Examples

Constructors

Methods


Constructors

constructor

Creates a new subgraph builder with the specified ID.

Parameters

id
string
required
Unique identifier for the subgraph

Returns

SubgraphBuilder

Methods

addParameter

Adds a parameter to the subgraph that can be passed from the parent graph.

Parameters

config
object
required
Parameter configuration

Returns

this

addParameters

Adds multiple parameters to the subgraph at once.

Parameters

parameters
object
required
Array of parameter configurations

Returns

this

addNode

Adds a node to the subgraph.

Parameters

node
Node | AbstractNode
required
Node to add to the subgraph

Returns

this

addEdge

Adds an edge connecting two nodes in the subgraph.

Parameters

fromNode
string | Node | AbstractNode
required
Source node or node ID
toNode
string | Node | AbstractNode
required
Destination node or node ID
options
object
Optional edge configuration

Returns

this

setStartNode

Sets the start node of the subgraph (subgraphs can only have one start node).

Parameters

node
string | Node | AbstractNode
required
Start node or node ID

Returns

this

setEndNode

Sets the end node of the subgraph (subgraphs can only have one end node).

Parameters

node
string | Node | AbstractNode
required
End node or node ID

Returns

this

build

Builds and returns the final subgraph configuration.

Returns

Subgraph