| 1 |
filetype: graphql |
| 2 |
|
| 3 |
detect: |
| 4 |
filename: "\\.(gql|graphql)$" |
| 5 |
|
| 6 |
rules: |
| 7 |
- type: "\\b(?:(query|mutation|subscription|type|input|scalar|fragment|schema|union|on|extends?))\\b" |
| 8 |
|
| 9 |
# scalar types |
| 10 |
- statement: "\\b(ID|Int|Float|Boolean|String|Datetime|Null)\\b" |
| 11 |
|
| 12 |
# introspection types |
| 13 |
- statement: "(__\\w+)" |
| 14 |
|
| 15 |
# parameters |
| 16 |
- statement: "((\\w+)(?:\\:([\\s]*)?)(?:\\$))" |
| 17 |
|
| 18 |
# directive locations |
| 19 |
- 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)\\b" |
| 20 |
|
| 21 |
# directives |
| 22 |
- constant: "(@\\w+)" |
| 23 |
|
| 24 |
# root types |
| 25 |
- constant: "\\b(Query|Mutation|Subscription|Schema|Root)\\b" |
| 26 |
|
| 27 |
# variables |
| 28 |
- special: "(\\$\\w+)" |
| 29 |
|
| 30 |
# required symbol |
| 31 |
- special: "(!)" |
| 32 |
|
| 33 |
- symbol: "(:|=|\\||\\(|\\)|\\{|\\}|\\[|\\])" |
| 34 |
|
| 35 |
- constant.bool: "\\b(true|false)\\b" |
| 36 |
|
| 37 |
- constant.string: |
| 38 |
start: "\"" |
| 39 |
end: "\"" |
| 40 |
skip: "\\\\." |
| 41 |
rules: |
| 42 |
- constant.specialChar: "\\\\." |
| 43 |
|
| 44 |
- comment: |
| 45 |
start: "#" |
| 46 |
end: "$" |
| 47 |
rules: [] |