# `MixAffected.Graph.Source.XrefJson`
[🔗](https://github.com/mnox/mix_affected/blob/v0.1.0/lib/mix_affected/graph/source/xref_json.ex#L1)

`MixAffected.Graph.Source` over `mix xref graph --format json` (Elixir >= 1.19).

The JSON is a two-level map: source file to `%{sink file => kind}`, where
kind is `"compile"`, `"export"` or `"runtime"`, and files without
dependencies map to `{}`. Anything else is a `{:parse_error, detail}`.
On Elixir 1.18 the format does not exist and `fetch/2` fails open with
`{:xref_failed, status, output}`.

# `parse`

```elixir
@spec parse(String.t()) ::
  {:ok, MixAffected.Graph.adjacency()} | {:error, MixAffected.Graph.error()}
```

Parses `mix xref graph --format json` output into adjacency.

---

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