Setting up Apollo Workbench
First, download the following required applications and extensions:
- If you haven't yet, install VS Code.
- Install the Apollo GraphQL VS Code Extension.
- This extension provides code completion when writing schemas and queries.
- Install the latest Apollo Workbench release.
- You can view past releases here.
After you install the extension, it adds a Workbench icon to your VS Code Activity Bar:
The Workbench navigation panel is divided into three sections:
- Local supergraph designs. This lists all of the
.apollo-workbenchfiles contained in the directory VS Code is opened to.
- Apollo Studio graphs. This lists all of the graphs you have access to in Apollo Studio. You can use this list to create a new design based on an existing graph.
- To populate this list, you need to authenticate Workbench with Studio.
- Apollo Studio graph operations. This lists all of the GraphQL operations associated with whichever Apollo Studio graph is selected.
Workbench can connect to Apollo Studio, enabling you to create designs based on your existing federated graphs. You can also push your local designs to Studio to create new graphs.
To log in to Studio from Workbench:
Open VS Code to any folder.
From the Workbench tab in VS Code, click Click here to login with your user api key. (You can also run the
logincommand in the command palette.) Paste your API key into the input box:
This saves the API key to your VS Code extension state.
You need to open a folder in VS Code to create designs in Workbench. Workbench uses this folder to store your designs.
Apollo Workbench prints informative logs as you use it. To view the logs, select View > Output. Then in the Output panel, select Apollo Workbench from the dropdown menu in the upper right.