Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax highlighting fails when seeing .graphql` #135

Open
ericclemmons opened this issue May 7, 2019 · 1 comment
Open

Syntax highlighting fails when seeing .graphql` #135

ericclemmons opened this issue May 7, 2019 · 1 comment

Comments

@ericclemmons
Copy link

const query = require('fs').readFileSync(`${__dirname}/MyQuery.graphql`, 'utf8');

describe('some test' () => {
  it('should do something', async () => {
    return request
      .post('/graphql')
      .send({ query, variables })
      .expect(res => expect(res.body).toMatchSnapshot())
      .expect(206);
  });
});

//   Some
//   comments

I was able to confirm that the following works:

const query = require('fs').readFileSync(__dirname + '/MyQuery.graphql', 'utf8');

So the issue is with graphql + backtick.

@ericclemmons
Copy link
Author

This seems to be the culprit, but I don't understand the capture annotation (yet):

"begin": "(`)(#graphql)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.string.template.begin.js"
},
"2": {
"name": "comment.line.graphql.js"
}
},
"end": "`",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant