JS GraphQL plugin syntax highlight not working with custom tag functions

It works fine with "graphql-tag", but in my case there is a wrapper around it and syntax highlight doesn't work. Is there a way to make JS GraphQL work with custom tag functions? 

4 comments
Comment actions Permalink

You can inject GraphQl manually in it using comment:

// language=GraphQL
const schema = createGql(``

Or, inject it via Alt+Enter, Inject language or Reference:

0
Comment actions Permalink

Thanks, didn't know about both of those tricks. While this is a solution, it doesn't feel right to add comments or inject syntax every time, I have around hundred of gql operations in my average-size project, I can only image how many operations are there in large applications.

I wish there was an option in the plugin to specify packages/utilities as graphql tag functions for the syntax highlight to apply. 

0
Comment actions Permalink

The graphql plugin use to work exactly at describe above, that is, gql`query...` so the answer above is incorrect. It now seem broken and useless in the recent release!

0

Please sign in to leave a comment.