# `RiddlerGraphQL.Types.Answer`
[🔗](https://github.com/riddler/riddler_graphql/blob/v0.1.0/lib/riddler_graphql/types/answer.ex#L1)

The `JourneyAnswer` union: what a client reads when it asks where a Journey
is.

A host imports these types into its own schema with
`import_types RiddlerGraphQL.Types.Answer`, beside
`import_types RiddlerGraphQL.Types.JSON`, whose `RiddlerJSON` scalar they
use. Each type reads the string-keyed map `Riddler.Journey.present/3`
answers, and the union resolves by that map's `"state"`:

| `"state"` | Type | Fields |
|---|---|---|
| `"screen"` | `JourneyScreen` | `screen` (`JourneyScreenInfo`: `key`, `title`), `elements: RiddlerJSON!`, `moves` (`JourneyMoves`: `outcomes`, `back`), `progress` (`JourneyProgress`: `step`, `of`) |
| `"waiting"` | `JourneyWaiting` | `reason`, `retryAfterMs` |
| `"done"` | `JourneyDone` | `result: RiddlerJSON` |

`title` is null where the document wrote none; `progress` is null where the
host supplied none; `reason`, `retryAfterMs` and `result` are null where the
answer carries none. The screen's resolution diagnostics are on no type:
they describe the document and the root, which are the host's, and the host
reads them from the answer its own call returned.

---

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