# `Jizoku.GraphMutation.Operation`
[🔗](https://github.com/dark-trench/jizoku/blob/main/lib/jizoku/graph_mutation/operation.ex#L1)

One normalized node or edge operation in a graph mutation.

This contract validates transport shape only. Graph identity, topology,
lifecycle, and limit validation belong to the runtime validator.

# `kind`

```elixir
@type kind() :: :node | :edge
```

# `mode`

```elixir
@type mode() :: :addition | :removal
```

# `public_mode`

```elixir
@type public_mode() :: :add | :remove
```

# `t`

```elixir
@type t() :: %Jizoku.GraphMutation.Operation{
  action: String.t() | nil,
  from: String.t() | nil,
  id: String.t(),
  input: map() | nil,
  kind: kind(),
  queue: String.t() | nil,
  to: String.t() | nil
}
```

# `canonical`

```elixir
@spec canonical(t()) :: tuple()
```

Returns the ordered operation content used by mutation identity.

# `normalize`

```elixir
@spec normalize(term(), mode()) :: {:ok, t()} | {:error, {term(), atom()}}
```

Normalizes one operation for its addition or removal context.

# `to_map`

```elixir
@spec to_map(t()) :: map()
```

Converts an operation to its deterministic persistence map.

# `to_public_map`

```elixir
@spec to_public_map(t(), public_mode()) :: map()
```

Converts an operation to a redacted report summary.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
