graphql-for-vscode icon indicating copy to clipboard operation
graphql-for-vscode copied to clipboard

Syntax highlighting fails when seeing .graphql`

Open ericclemmons opened this issue 6 years ago • 1 comments

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 avatar May 07 '19 20:05 ericclemmons

This seems to be the culprit, but I don't understand the capture annotation (yet): https://github.com/kumarharsh/graphql-for-vscode/blob/1cdee66d518dd3bf0c741c0422d7a618d32256d0/syntaxes/graphql.js.json#L38-L47

ericclemmons avatar May 07 '19 20:05 ericclemmons