Builds
Introduction
A build is a fully-functional, immutable supergraph API which is built based on your project's configuration.
Builds can be used to incrementally test your project's API.
While there can be many builds for a project, only one can be applied at a time. The applied build is the one that is currently serving your API from a project's endpoint.
A 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.
Build lifecycle
Create
To create a build, you'll first need a project. After which, you can create a build using the following command:
ddn build supergraph-manifest
The CLI will return information about your build:
+---------------+------------------------------------------------------------------+
| Build ID | 7af001cc-5fdd-4638-aa23-96c49cd45d42 |
+---------------+------------------------------------------------------------------+
| Build Version | 606b3d797d |
+---------------+------------------------------------------------------------------+
| Build URL | https://stunning-eagle-6335-dev-606b3d797d.ddn.hasura.me/graphql |
+---------------+------------------------------------------------------------------+
| Project Id | 3172bf76-1d6f-4869-9ee2-7147b964cc5e |
+---------------+------------------------------------------------------------------+
| Console Url | https://console.hasura.com/project/stunning-eagle-6335/graphql |
+---------------+------------------------------------------------------------------+
| FQDN | stunning-eagle-6335-dev-606b3d797d.ddn.hasura.me |
+---------------+------------------------------------------------------------------+
| Environment | dev |
+---------------+------------------------------------------------------------------+
| Description | |
+---------------+------------------------------------------------------------------+
Overriding the default manifest
By default, the build will be created using the manifest you've identified as the default for your project in your
hasura.yaml
file. You can override this by specifying a different manifest using the --supergraph-manifest
flag:
ddn build supergraph-manifest --supergraph-manifest <MANIFEST_FILE>
At this point, you can interact with and test your API using the GraphQL API endpoint and Console URL returned by the CLI.
Apply
When you are happy with your build, you can apply it to a project using the following command:
ddn apply supergraph-build <build-version>
The CLI will return the API endpoint for your supergraph:
+---------+----------------------------------------------------+
| API URL | https://secure-catfish-9299.ddn.hasura.app/graphql |
+---------+----------------------------------------------------+
Delete
Builds can be individually deleted using the following command:
ddn delete supergraph-build --version <BUILD_VERSION>
All builds for a project are deleted when a project is deleted.