@mermaid-editor-sdk/headless / addERRelationship
Function: addERRelationship()
addERRelationship(
source,from,to,cardinality?,label?,identifying?):string
Defined in: source/er-mutations.ts:526
Adds a relationship between two ER entities.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
source | string | — | Mermaid source to inspect or update. |
from | string | — | Source element identifier. |
to | string | — | Target element identifier. |
cardinality? | ERCardinality | 'one-many' | Relationship cardinality. |
label? | string | 'relates' | Displayed label. |
identifying? | boolean | true | Whether the relationship is identifying. |
Returns
string