RiddlerGraphQL.Types.Answer (RiddlerGraphQL v0.1.0)

Copy Markdown View Source

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"TypeFields
"screen"JourneyScreenscreen (JourneyScreenInfo: key, title), elements: RiddlerJSON!, moves (JourneyMoves: outcomes, back), progress (JourneyProgress: step, of)
"waiting"JourneyWaitingreason, retryAfterMs
"done"JourneyDoneresult: 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.