Skip to content
🤷

Forgive us! These docs are a work in progress. Some pages may be incomplete or describe features that aren't quite finished yet. Farkitect is in early development and we don't recommend using it for real work just yet. Feel free to explore — just be aware that things are still being built.

Relationship Constraints Reference

Constraints restrict which element types a relationship type can connect. They are defined as a list of valid pairs — each specifying a source element type and a target element type.

"constraints": {
"validPairs": [
{ "source": "application-component", "target": "application-service" },
{ "source": "application-component", "target": "application-component" }
]
}

Each pair references element types by their $id.

  • When drawing a relationship on the Canvas, only valid source/target pairs are allowed
  • The relationship type picker only shows types that have a valid pair for the selected source and target
  • Invalid attempts are silently prevented — no relationship is created

A relationship type with no constraints (empty validPairs or omitted constraints) can connect any two elements. This is useful for general-purpose relationships like Association.

"constraints": {}

Some built-in relationship types use "*" as a wildcard for one end:

{ "source": "note", "target": "*" }

This means the source must be a Note, but the target can be any element type.

The integrity checker can detect M1 relationships that violate their M2 type’s constraints. This can happen when:

  • An M2 constraint is added or tightened after M1 relationships were already created
  • A .farki file is imported with relationships that don’t match the available M2 constraints

Violations are reported as warnings — existing relationships are not automatically deleted.