# APOC graph mutations

[Wiki](../README.md) / [APOC compatibility](README.md)

## Transactional APOC writes

| Procedure | Behaviour |
|---|---|
| `apoc.merge.node(labels, identity[, onCreate, onMatch])` | Dynamic label/property merge; yields `node` |
| `apoc.merge.relationship(start, type, identity, onCreate, end[, onMatch])` | Directed relationship merge; yields `rel` |
| `apoc.refactor.mergeNodes(nodes[, config])` | Merge onto the first node, combining labels and redirecting relationships; yields `node` |
| `apoc.create.node(labels, properties)` | Dynamic creation compatibility helper; yields `node` |
| `apoc.create.relationship(start, type, properties, end)` | Dynamic relationship creation; yields `rel` |

Null identity properties are refused. `mergeNodes` supports a single
`properties` policy (`overwrite`, `discard`, `combine`), `mergeRels`,
`produceSelfRef`, `preserveExistingSelfRels`, `singleElementAsArray`. Duplicate
node arguments are deduplicated. Parallel relationships are merged only when
requested, preserving their direction/type; combine removes duplicate property
values. Per-property regex policies and other APOC refactor options are refused.
Every relationship touching a merged node, including the target's own, is
recreated and receives a new ID. All changes are atomic, maintain
indexes and constraints and are refused by read-only execution.

## Related articles

[Procedures, subqueries and parameters](../cypher/subqueries.md) · [Batched subqueries and logical interchange](../imports/interchange.md) · [Graph data science](../gds/README.md)
