Docs
Launch GraphOS Studio
You're viewing documentation for a previous version of this software. Switch to the latest stable version.

Exporting Workbench designs


When you finish designing your federated in Workbench, you can export your work for use in your project.

Workbench enables you to export any of the following:

  • An entire template project based on your design
  • A single in your design
  • Entity resolvers
    for a single in your design

Exporting a local template project

To export a template project from your Workbench design, right-click the design in the navigation panel and select Export design into a local project:

Export design to local project

Workbench creates a template project with the following structure:

Getting started project structure

The project's top-level directory matches the name of the design you exported from.

The exported project contains:

  • graph-router, a folder containing the source for your federated 's gateway
  • subgraphs, a folder containing a source subfolder for each
  • A .code-workspace config file that helps you run the entire project locally

Open the project's workspace

After you export your template project, open its .code-workspace file (VS Code should prompt you to do this automatically). Click the Open Workspace button that appears in the bottom-right corner of VS Code:

Getting started project structure

Run the setup command

Opening the project's workspace enables you to run helpful tasks in the VS Code Command Palette (View > Command Palette). There's a separate setup task for each source folder in the project, along with a compound setup task (named just setup):

Getting started project structure

The compound setup task runs npm install for each directory and then uses the to compose the for your gateway.

Run and debug

After you set up the template project, you can try out debugging it. Open the Debug tab in VS Code to view and config commands for individual , along with a Launch All option that runs your gateway and all in debug mode:

Getting started project structure

Exporting to Studio

After you export a design to Studio, that Studio does not automatically receive any updates you make in Workbench. Exporting is a one-time .

Documentation forthcoming.

Exporting from individual subgraphs

You can export the following for an individual in your design:

  • The 's schema
  • An example set of reference for all
    entities
    defined in the

To do so, right-click any in your Workbench design and select the appropriate option (Export Subgraph Schema or Export Subgraph Entity Resolvers):

Getting started project structure
Previous
Testing graphs locally
Next
@apollo/subgraph
Edit on GitHubEditForumsDiscord

© 2024 Apollo Graph Inc.

Privacy Policy

Company