The root fields a host adds to its own schema: JourneyQueries, the query
fields, and JourneyMutations, the mutation fields, with JourneyPayload,
what each mutation answers.
A host imports this module's types beside the types they use, then the two objects' fields into the root query and root mutation types it already has, next to its own fields:
import_types RiddlerGraphQL.Types.JSON
import_types RiddlerGraphQL.Types.Answer
import_types RiddlerGraphQL.Types.Finding
import_types RiddlerGraphQL.Types.Scope
import_types RiddlerGraphQL.Types.Journey
query do
import_fields :journey_queries
end
mutation do
import_fields :journey_mutations
end| Root field | Arguments | Answers |
|---|---|---|
journey | id: ID!, draft: RiddlerJSON | JourneyAnswer |
startJourney | path: ID!, scope: JourneyScopeInput! | JourneyPayload |
submitJourney | journey: ID!, screen: String!, outcome: String!, responses: RiddlerJSON! | JourneyPayload |
goBack | journey: ID!, screen: String! | JourneyPayload |
JourneyPayload has three fields: journey: ID!, the host's name for the
Journey; answer: JourneyAnswer, null when the payload answers findings;
and findings: [JourneyFinding!]!, empty when the host takes the mutation.