diff --git a/autotests/folding/highlight.graphql.fold b/autotests/folding/highlight.graphql.fold new file mode 100644 index 0000000..a4f4a77 --- /dev/null +++ b/autotests/folding/highlight.graphql.fold @@ -0,0 +1,31 @@ +# Examples taken from https://graphql.org/learn/schema/#type-language +# +# Alerts: TODO FIXME + +query Hero($episode: Episode, $withFriends: Boolean!) { + hero(episode: $episode) { + name + friends @include(if: $withFriends) { + } + } +} + +query { + droid(id: "2000", num: 42, active: true) { + name + } +} + +type Person @addExternalFields(source: "profiles") @excludeField(name: "photo") { + name: String +} + +# block strings (from https://github.com/graphql/graphql-spec/blob/master/spec/Section%202%20--%20Language.md) + +""" +This starts with and ends with an empty line, +which makes it easier to read. +""" + +"""This does not start with or end with any empty lines, +which makes it a little harder to read.""" diff --git a/autotests/html/highlight.graphql.html b/autotests/html/highlight.graphql.html new file mode 100644 index 0000000..77d75e4 --- /dev/null +++ b/autotests/html/highlight.graphql.html @@ -0,0 +1,38 @@ + + + +highlight.graphql + +
+# Examples taken from https://graphql.org/learn/schema/#type-language
+#
+# Alerts: TODO FIXME
+
+query Hero($episode: Episode, $withFriends: Boolean!) {
+  hero(episode: $episode) {
+    name
+    friends @include(if: $withFriends) {
+    }
+  }
+}
+
+query {
+  droid(id: "2000", num: 42, active: true) {
+    name
+  }
+}
+
+type Person @addExternalFields(source: "profiles") @excludeField(name: "photo") {
+  name: String
+}
+
+# block strings (from https://github.com/graphql/graphql-spec/blob/master/spec/Section%202%20--%20Language.md)
+
+"""
+This starts with and ends with an empty line,
+which makes it easier to read.
+"""
+
+"""This does not start with or end with any empty lines,
+which makes it a little harder to read."""
+
diff --git a/autotests/input/highlight.graphql b/autotests/input/highlight.graphql new file mode 100644 index 0000000..c2293e0 --- /dev/null +++ b/autotests/input/highlight.graphql @@ -0,0 +1,31 @@ +# Examples taken from https://graphql.org/learn/schema/#type-language +# +# Alerts: TODO FIXME + +query Hero($episode: Episode, $withFriends: Boolean!) { + hero(episode: $episode) { + name + friends @include(if: $withFriends) { + } + } +} + +query { + droid(id: "2000", num: 42, active: true) { + name + } +} + +type Person @addExternalFields(source: "profiles") @excludeField(name: "photo") { + name: String +} + +# block strings (from https://github.com/graphql/graphql-spec/blob/master/spec/Section%202%20--%20Language.md) + +""" +This starts with and ends with an empty line, +which makes it easier to read. +""" + +"""This does not start with or end with any empty lines, +which makes it a little harder to read.""" diff --git a/autotests/reference/highlight.graphql.ref b/autotests/reference/highlight.graphql.ref new file mode 100644 index 0000000..2a6d08d --- /dev/null +++ b/autotests/reference/highlight.graphql.ref @@ -0,0 +1,31 @@ +# Examples taken from https://graphql.org/learn/schema/#type-language
+#
+# Alerts: TODO FIXME
+
+query Hero($episode: Episode, $withFriends: Boolean!) {
+ hero(episode: $episode) {
+ name
+ friends @include(if: $withFriends) {
+ }
+ }
+}
+
+query {
+ droid(id: "2000", num: 42, active: true) {
+ name
+ }
+}
+
+type Person @addExternalFields(source: "profiles") @excludeField(name: "photo") {
+ name: String
+}
+
+# block strings (from https://github.com/graphql/graphql-spec/blob/master/spec/Section%202%20--%20Language.md)
+
+"""
+This starts with and ends with an empty line,
+which makes it easier to read.
+"""
+
+"""This does not start with or end with any empty lines,
+which makes it a little harder to read."""
diff --git a/data/syntax/graphql.xml b/data/syntax/graphql.xml new file mode 100644 index 0000000..b582435 --- /dev/null +++ b/data/syntax/graphql.xml @@ -0,0 +1,83 @@ + + + + + + + enum + extend + fragment + implements + input + interface + mutation + on + query + scalar + schema + subscription + type + union + + + null + true + false + + + Boolean + Float + ID + Int + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +