Configure graphql syntax highlight in IntelliJ IDE's
To enable syntax highlight in graphql query/mutation definition in IntelliJ IDE’s follow few steps.
Initially gql query is displayed as regular string.
Step 1
In editor preferences > plugins > marketplace find JS GraphQL plugin
Step 2
Then you need to configure .graphqlconfig by selecting: new > GraphQL Configuration File in project root file
schemaPath property should point to schema.graphql file in your project
Step 3
If you configure the application correctly you should see the schema discovered and “No errors found”
End result
Now you should see syntax highlight, suggestions and validation based on graphql schema.
Additional info
If you have problems with the setup checkout the plugin documentation
Tweet