# `DocShell.Presentation.GraphProjector`
[🔗](https://github.com/futhr/doc_shell/blob/v2.0.0/lib/doc_shell/presentation/graph_projector.ex#L1)

Port implemented by graph-backed hosts to produce DocShell presentation data.

A host projector reads its own store and answers with the same
`t:DocShell.Presentation.Source.presentation/0` the built-in generator
produces. `project/2` checks the answer before returning it, because a
projector lives in another repository: a shape mistake there would otherwise
surface as a renderer bug in a third one.

# `project`

```elixir
@callback project(keyword()) ::
  {:ok, DocShell.Presentation.Source.presentation()} | {:error, term()}
```

# `project`

```elixir
@spec project(module(), keyword()) ::
  {:ok, DocShell.Presentation.Source.presentation()} | {:error, term()}
```

Invokes a host graph projector, then validates the shape it returned.

# `validate`

```elixir
@spec validate(term()) ::
  {:ok, DocShell.Presentation.Source.presentation()} | {:error, term()}
```

Checks a presentation against the contract.

Returns `{:error, {:invalid_presentation, reason}}` rather than a boolean so a
host sees which part of the shape it got wrong.

---

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