Supergraph Builds
Introduction
A supergraph build is a fully-functional, immutable supergraph API which is generated based on your project's configuration.
Supergraph builds can be used to incrementally test your project's API with a unique build URL.
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.
You can create a supergraph build locally or in the cloud on Hasura DDN.
They are lightweight and can be created as often as you like to check your changes.
Builds are simply a large set of JSON objects that describe the supergraph. The Hasura engine then uses this description to serve your API.
Follow the steps in the Quickstart to set up a project with a supergraph, in order work with builds.
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>
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.