async-graphql-parser 1.17.3

GraphQL query parser for async-graphql
Documentation
WHITESPACE = _{ " " | "," | "\t" | "\u{feff}" | NEWLINE }
COMMENT = _{ "#" ~ (!"\n" ~ ANY)* }

// value
int    = @{ "-"? ~ ("0" | (ASCII_NONZERO_DIGIT ~ ASCII_DIGIT*)) }
float  = @{ "-"? ~ int ~ "." ~ ASCII_DIGIT+ ~ exp? }
exp    = @{ ("E" | "e") ~ ("+" | "-")? ~ ASCII_DIGIT+ }

singleline_string = @{ "\"" ~ singleline_inner ~ "\"" }
singleline_inner  = @{ (!("\"" | "\\") ~ ANY)* ~ (escape ~ singleline_inner)? }
multiline_inner   = @{ (!("\"\"\"" | "\\") ~ ANY)* ~ (escape ~ multiline_inner)? }
multiline_string  = @{ "\"\"\"" ~ multiline_inner ~ "\"\"\"" }
string            = @{ multiline_string | singleline_string }
escape  = @{ "\\" ~ ("\"" | "\\" | "/" | "b" | "f" | "n" | "r" | "t" | unicode) }
unicode = @{ "u" ~ ASCII_HEX_DIGIT{4} }

boolean = { "true" | "false" }
null = { "null" }
name = @{ (ASCII_ALPHA | "_") ~ (ASCII_ALPHA | ASCII_DIGIT | "_")* }

array = { "[" ~ value* ~ "]" }

pair = { name ~ ":" ~ value }
object = { "{" ~ pair* ~ "}" }

value = { object | array | float | int | string | null | boolean | name }

// type
list_type = { "[" ~ type_ ~ "]" }
nonnull_type = { (list_type | name) ~ "!" }
type_ = { nonnull_type | list_type | name }

// type system
arguments = { "(" ~ pair* ~ ")" }
directive = { "@" ~ name ~ arguments? }
directives = { directive* }
schema_definition = { extend? ~ "schema" ~ directives? ~ "{" ~ root_operation_type_definition* ~ "}" }
operation_type = @{ "query" | "mutation" | "subscription" }
root_operation_type_definition = { operation_type ~ ":" ~ name }
extend = { "extend" }
sclar_type_definition = { string? ~ extend? ~ "scalar" ~ name ~ directives? }
implements_interfaces = { "implements" ~ "&"? ~ name ~ ("&" ~ name)* }
default_value = { "=" ~ value }
input_value_definition = { string? ~ name ~ ":" ~ type_ ~ default_value? ~ directives? }
arguments_definition = { "(" ~ input_value_definition* ~ ")" }
field_definition = { string? ~ name ~ arguments_definition? ~ ":" ~ type_ ~ directives? }
fields_definition = { "{" ~ field_definition* ~ "}" }
object_type_definition = { string? ~ extend? ~ "type" ~ name ~ implements_interfaces? ~ directives? ~ fields_definition? }
interface_type_definition = { string? ~ extend? ~ "interface" ~ name ~ implements_interfaces? ~ directives? ~ fields_definition? }
union_member_types = { "=" ~ "|"? ~ name ~ ("|" ~ name)* }
union_type_definition = { string? ~ extend? ~ "union" ~ name ~ directives? ~ union_member_types? }
enum_value_definition = { string? ~ name ~ directives? }
enum_values_definition = { "{" ~ enum_value_definition* ~ "}" }
enum_type_definition = { string? ~ extend? ~ "enum" ~ name ~ directives? ~ enum_values_definition? }
input_fields_definition = { "{" ~ input_value_definition* ~ "}" }
input_type_definition = { string? ~ extend? ~ "input" ~ name ~ directives? ~ input_fields_definition? }
executable_directive_location = @{ "QUERY" | "MUTATION" | "SUBSCRIPTION" | "FIELD" | "FRAGMENT_DEFINITION" | "FRAGMENT_SPREAD" | "INLINE_FRAGMENT" }
type_system_directive_location = @{ "SCHEMA" | "SCALAR" | "OBJECT" | "FIELD_DEFINITION" | "ARGUMENT_DEFINITION" | "INTERFACE" | "UNION" | "ENUM" | "ENUM_VALUE" | "INPUT_OBJECT" | "INPUT_FIELD_DEFINITION"}
directive_location = @{ executable_directive_location | type_system_directive_location }
directive_locations = { "|"? ~ directive_location ~ ("|" ~ directive_location)* }
directive_definition = { string? ~ "directive" ~ "@" ~ name ~ arguments_definition ~ "on" ~ directive_locations }
definition = {
    schema_definition |
    sclar_type_definition |
    object_type_definition |
    interface_type_definition |
    union_type_definition |
    enum_type_definition |
    input_type_definition |
    directive_definition
}
document = { SOI ~ definition+ ~ EOI}