aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/javascript
diff options
context:
space:
mode:
authorJared Ramirez2022-01-21 14:16:40 +0000
committerGitHub2022-01-21 14:16:40 +0000
commit0b55b21f3069640d37d2fa34bd413986177c0cd7 (patch)
tree13679376b094c285d409422c5df6bb590892718b /runtime/queries/javascript
parentf453f8724dc9374d6a88c19d83ba84e7d74dcac2 (diff)
feat(languages): GraphQL (#1515)
* Add Graphql language support * Fix docs gen * Add JS Graphql injection query * Updates based on PR feedback Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Diffstat (limited to 'runtime/queries/javascript')
-rw-r--r--runtime/queries/javascript/injections.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/queries/javascript/injections.scm b/runtime/queries/javascript/injections.scm
index 5539241a..e8429111 100644
--- a/runtime/queries/javascript/injections.scm
+++ b/runtime/queries/javascript/injections.scm
@@ -9,6 +9,14 @@
]
arguments: (template_string) @injection.content)
+; Parse the contents of gql template literals
+
+((call_expression
+ function: (identifier) @_template_function_name
+ arguments: (template_string) @injection.content)
+ (#eq? @_template_function_name "gql")
+ (#set! injection.language "graphql"))
+
; Parse regex syntax within regex literals
((regex_pattern) @injection.content