Skip to content

Refactor routing condition GraphQL schema

Samiwel Thomas edited this page Oct 25, 2018 · 3 revisions

The GraphQL schema for routing condition and routing condition values could be simplified and more closely aligned to the schema definitions for the validation types.

The plan is to migrate the schema from looking like this:

type RoutingCondition {
   id: ID!
   comparator: RoutingComparator
   questionPage: QuestionPage
   answer: Answer
   routingValue: RoutingConditionValue
 }
 
 type IDArrayValue {
  value: [ID]
}

type NumberValue {
  id: ID!
  numberValue: Int 
}
 union RoutingConditionValue = IDArrayValue | NumberValue

to something a bit more like this:

type RoutingCondition {
  id: ID!
  comparator: RoutingComparator
  questionPage: QuestionPage
  answer: Answer
  multipleChoiceValues: [Option!]
  numberValue: Int
  dateValue: Date
}
Clone this wiki locally