Skip to main content
Version: v3.x

Supergraph Builds

Introduction

A supergraph build is a fully-functional, immutable supergraph API which is built based on your project's configuration.

Supergraph builds can be used to incrementally test your project's API.

While there can be many supergraph builds for a project, only one can be applied at a time. The applied supergraph build is the one that is currently serving your API from the project's endpoint.

A supergraph build is not created in your local directory, but is rather created and stored in the Hasura DDN service. They are lightweight and can be created as often as you like to check your changes.

Create a new supergraph build

To create a supergraph build, you'll first need a Hasura DDN project. After which, you can create a cloud supergraph build using the following command:

ddn supergraph build create --supergraph ./supergraph.cloud.yaml --project <project-name>
Cloud and local builds

For cloud builds you first need your cloud project and subgraphs set up.

To create a local supergraph build, switch out the supergraph.cloud.yaml file with the supergraph. local.yaml file.

The CLI will return information about your supergraph build:

+---------------+------------------------------------------------------------------+
| Build Version | 606b3d797d |
+---------------+------------------------------------------------------------------+
| Build URL | https://stunning-eagle-6335-dev-606b3d797d.ddn.hasura.me/graphql |
+---------------+------------------------------------------------------------------+
| Console Url | https://console.hasura.com/project/stunning-eagle-6335/graphql |
+---------------+------------------------------------------------------------------+
| FQDN | stunning-eagle-6335-dev-606b3d797d.ddn.hasura.me |
+---------------+------------------------------------------------------------------+
| Description | |
+---------------+------------------------------------------------------------------+

List all supergraph builds

You can list all supergraph builds created in a project using the following command:

ddn supergraph build get --project <project-name>

Apply a supergraph build to its project

When you are happy with your build, you can apply it to the project using the following command:

ddn supergraph build apply <build-version> --project <project-name>

Delete a supergraph build

Supergraph builds can be individually deleted using the following command:

ddn supergraph build delete <build-version> --project <project-name>

All supergraph builds for a project are deleted when a project is deleted.

Loading...