Skip to content

Commit 0a9f19b

Browse files
Merge pull request #24 from ntkoopman/master
Add support for Apollo's gql template literal
2 parents 3a3fa1c + 3bd5b38 commit 0a9f19b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/com/intellij/lang/jsgraphql/ide/injection/JSGraphQLLanguageInjectionUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public class JSGraphQLLanguageInjectionUtil {
2222

2323
public static final String RELAY_QL_TEMPLATE_TAG = "Relay.QL";
2424
public static final String GRAPHQL_TEMPLATE_TAG = "graphql";
25+
public static final String APOLLO_GQL_TEMPLATE_TAG = "gql";
2526

2627
public enum JSGraphQLInjectionTag {
2728
RelayQL,
@@ -49,7 +50,7 @@ public static boolean isJSGraphQLLanguageInjectionTarget(PsiElement host, @Nulla
4950
final PsiElement firstChild = template.getFirstChild();
5051
if (firstChild instanceof JSReferenceExpression) {
5152
final String tagText = firstChild.getText();
52-
if (RELAY_QL_TEMPLATE_TAG.equals(tagText) || GRAPHQL_TEMPLATE_TAG.equals(tagText)) {
53+
if (RELAY_QL_TEMPLATE_TAG.equals(tagText) || GRAPHQL_TEMPLATE_TAG.equals(tagText) || APOLLO_GQL_TEMPLATE_TAG.equals(tagText)) {
5354
if(tagRef != null) {
5455
tagRef.set(RELAY_QL_TEMPLATE_TAG.equals(tagText) ? JSGraphQLInjectionTag.RelayQL : JSGraphQLInjectionTag.GraphQL);
5556
}

0 commit comments

Comments
 (0)