Developing Connectors in JetBrains IDEs
Configure Apollo's Plugin to validate Apollo Connectors
The JetBrains Apollo GraphQL plugin can give you fast feedback on your connectors in IntelliJ, WebStorm, and other JetBrains IDEs. Through it, you can get the same validations that composition provides, with errors and hints highlighted in your schema file on each save.
Prerequisites
These composition-based diagnostics are powered by Rover, starting with version 0.27.0-preview.0. You need this version or later installed to use composition-based diagnostics.
latest
version of Rover won't give you the pre-release
version 0.27.0-preview.0. You need to specify this exact version until 0.27.0
is released.Use the following command to install the correct version:
1curl -sSL https://rover.apollo.dev/nix/v0.27.0-preview.0 | sh
Configuration
Install the plugin.
Enable the Rover integration by going to Setting > Languages & Frameworks > GraphQL > Rover and checking Enabled.
Ensure a
supergraph.yaml
file is in the root of your project. This configuration file is used for Rover commands likerover dev
,rover supergraph compose
, and this plugin.tipYou can set a different location for yoursupergraph.yaml
in the LSP Arguments > Supergraph config file field in the Rover integration settings.In your
supergraph.yaml
do the following:
Set the composition version to 2.10.0-preview.4.
Ensure every schema file you want feedback on is included in the
subgraphs
section.
Troubleshooting
Restart the language server
If you aren't seeing diagnostics, try restarting the language server by clicking the Apollo icon in the status bar.
Confirm your Rover version
You can see the currently installed Rover version in the plugin's settings, or by running rover --version
in a terminal.
Ensure you have version 0.27.0-preview.0 or later.
Debug logging
If the extension isn't working as expected, you can enable debug logging by going to Help > Diagnostic Tools > Debug Log Settings... and
adding Apollo
and #com.intellij.platform.lsp
to the list.
This settings adds detailed logs to IDE's log file, which can aid in debugging.