Anyone know how to quiet a GraphQL Syntax Error in VS Code with Apollo GraphQL extension?

On a sidenote @chewxy would it be helpful to have some kind of discuss category for GraphQL application development questions using GraphQL? Thinking of maybe questions concerning developing in different environments React, Vue, Go, etc.

Developing a React App and using VS Code for IDE and Apollo GraphQL extension. It throws an IDE syntax error when I use a template string for my query.

(Using the gql from graphql-tag package as it supports template strings like this. And the variable query is of type string. It is actually being pulled in from the database. Yes, the database is storing queries :wink: )

...
const PREPARED_QUERY = gql`${query}`
const data = useQuery(PREPARED_QUERY, queryOptions)
...

The code is functional, the only problem is that the IDE is throwing a syntax error on this:

Syntax Error: Unexpected <EOF>.GraphQL: Syntax

I understand this is because it is checking the query string to ensure that it is properly formatted and it does not understand the template string “hack”.

If I could just do some kind of comment to ignore checking the syntax of that query, then I would do that to ignore the error message and remove this nasty red dot telling me I have an error in my file.