mochi/ast

Types

pub type Argument {
  Argument(name: String, value: Value)
}

Constructors

  • Argument(name: String, value: Value)
pub type Definition {
  OperationDefinition(operation: Operation)
  FragmentDefinition(fragment: Fragment)
}

Constructors

pub type Directive {
  Directive(name: String, arguments: List(Argument))
}

Constructors

  • Directive(name: String, arguments: List(Argument))
pub type Document {
  Document(definitions: List(Definition))
}

Constructors

pub type Field {
  Field(
    alias: option.Option(String),
    name: String,
    arguments: List(Argument),
    directives: List(Directive),
    selection_set: option.Option(SelectionSet),
    location: option.Option(lexer.Position),
  )
}

Constructors

pub type Fragment {
  Fragment(
    name: String,
    type_condition: String,
    directives: List(Directive),
    selection_set: SelectionSet,
  )
}

Constructors

  • Fragment(
      name: String,
      type_condition: String,
      directives: List(Directive),
      selection_set: SelectionSet,
    )
pub type FragmentSpreadValue {
  FragmentSpreadValue(name: String, directives: List(Directive))
}

Constructors

  • FragmentSpreadValue(name: String, directives: List(Directive))
pub type InlineFragmentValue {
  InlineFragmentValue(
    type_condition: option.Option(String),
    directives: List(Directive),
    selection_set: SelectionSet,
  )
}

Constructors

pub type ObjectField {
  ObjectField(name: String, value: Value)
}

Constructors

  • ObjectField(name: String, value: Value)
pub type Operation {
  Operation(
    operation_type: OperationType,
    name: option.Option(String),
    variable_definitions: List(VariableDefinition),
    directives: List(Directive),
    selection_set: SelectionSet,
  )
  ShorthandQuery(selection_set: SelectionSet)
}

Constructors

pub type OperationType {
  Query
  Mutation
  Subscription
}

Constructors

  • Query
  • Mutation
  • Subscription
pub type Selection {
  FieldSelection(field: Field)
  FragmentSpread(fragment_spread: FragmentSpreadValue)
  InlineFragment(inline_fragment: InlineFragmentValue)
}

Constructors

pub type SelectionSet {
  SelectionSet(selections: List(Selection))
}

Constructors

pub type Type {
  NamedType(name: String)
  ListType(inner_type: Type)
  NonNullType(inner_type: Type)
}

Constructors

  • NamedType(name: String)
  • ListType(inner_type: Type)
  • NonNullType(inner_type: Type)
pub type Value {
  IntValue(value: Int)
  FloatValue(value: Float)
  StringValue(value: String)
  BooleanValue(value: Bool)
  NullValue
  EnumValue(value: String)
  ListValue(values: List(Value))
  ObjectValue(fields: List(ObjectField))
  VariableValue(name: String)
}

Constructors

  • IntValue(value: Int)
  • FloatValue(value: Float)
  • StringValue(value: String)
  • BooleanValue(value: Bool)
  • NullValue
  • EnumValue(value: String)
  • ListValue(values: List(Value))
  • ObjectValue(fields: List(ObjectField))
  • VariableValue(name: String)
pub type VariableDefinition {
  VariableDefinition(
    variable: String,
    type_: Type,
    default_value: option.Option(Value),
    directives: List(Directive),
  )
}

Constructors

Search Document