Last week we were happy to announce Visual Studio Code for Elixir. And now we’re introducing to you another cool thing – VSCode GraphQL extension! Features include intelligent autocompletion, jump-to-definition, syntax highlighting, query validation & a lot more.
Top 3 features of the new VS Code plugin
- Intelligent autocompletion. With the new VS Code plugin, your editor is now able to suggest types, fields and query arguments for your GraphQL code. The suggestions are based on the information provided in your GraphQL schema.
- Jump-to-definition. For example, when you see a field inside a GraphQL query and want to learn more about its type, you can now Ctrl+Click on that field and VS Code will open the type inside the original SDL schema definition.
Validate queries against your GraphQL schema. With the query validation feature, your editor will notify you about typos as well as structural and syntactical errors in your GraphQL code.
The plugin actually provides a lot more functionality:
- Syntax highlighting
- Validating SDL and outlining syntactical errors
- Hovering over types & fields shows their description
- Predefined code snippets (e.g. for creating new SDL types)
- Validation and autocompletion for Prisma directives
For the VS Code plugin, you can soon expect more features like better handling of custom directives, support for
graphql-import as well as associating your
gql tags with specific schemas (for multi-schema projects). If you want to find out more about the plugin features, you can use that source and other materials.