package graphql_parser

  1. Overview
  2. Docs

Module Graphql_parserSource

Sourcetype const_value = [
  1. | `Null
  2. | `Int of int
  3. | `Float of float
  4. | `String of string
  5. | `Bool of bool
  6. | `Enum of string
  7. | `List of const_value list
  8. | `Assoc of (string * const_value) list
]
Sourcetype value = [
  1. | `Null
  2. | `Int of int
  3. | `Float of float
  4. | `String of string
  5. | `Bool of bool
  6. | `Enum of string
  7. | `Variable of string
  8. | `List of value list
  9. | `Assoc of (string * value) list
]
Sourcetype directive = {
  1. name : string;
  2. arguments : (string * value) list;
}
Sourcetype fragment_spread = {
  1. name : string;
  2. directives : directive list;
}
Sourcetype selection =
  1. | Field of field
  2. | FragmentSpread of fragment_spread
  3. | InlineFragment of inline_fragment
Sourceand field = {
  1. alias : string option;
  2. name : string;
  3. arguments : (string * value) list;
  4. directives : directive list;
  5. selection_set : selection list;
}
Sourceand inline_fragment = {
  1. type_condition : string option;
  2. directives : directive list;
  3. selection_set : selection list;
}
Sourcetype fragment = {
  1. name : string;
  2. type_condition : string;
  3. directives : directive list;
  4. selection_set : selection list;
}
Sourcetype typ =
  1. | NamedType of string
  2. | ListType of typ
  3. | NonNullType of typ
Sourcetype variable_definition = {
  1. name : string;
  2. typ : typ;
  3. default_value : const_value option;
}
Sourcetype optype =
  1. | Query
  2. | Mutation
  3. | Subscription
Sourcetype operation = {
  1. optype : optype;
  2. name : string option;
  3. variable_definitions : variable_definition list;
  4. directives : directive list;
  5. selection_set : selection list;
}
Sourcetype definition =
  1. | Operation of operation
  2. | Fragment of fragment
Sourcetype document = definition list
Sourceval parse : string -> (document, string) result
Sourceval pp_document : document Fmt.t
OCaml

Innovation. Community. Security.