Skip to main content
Version: v3.x (DDN)

Deploying your project to Hasura DDN

Deploying your project to Hasura DDN is a simple process and can be done in 3 steps.

Deployment flow

  1. Initialize a project on Hasura DDN.
  2. Create a supergraph build on Hasura DDN.
  3. Apply the supergraph build to your project on Hasura DDN.

To begin this guide you will need to have a local project set up and running with at least one subgraph and connector. Check out the quickstart for more information on how to get started.

Step 1: Create a project on Hasura DDN

Initialize a project on Hasura DDN
ddn project init

You can optionally also append a project name to this command.

The CLI will respond with the project name, the subgraph(s) and env file which were created, and a hint to create a supergraph build.

You now have a project on Hasura DDN with the same subgraphs as you have locally. Currently, the subgraphs are empty.

Create vs Initialize

The ddn project init command is similar to ddn project create but it also creates the subgraphs and env file for you. ddn project create will only create an empty project and you will need to create the DDN project subgraphs and local .env.cloud file yourself.

Step 2: Create a supergraph build on Hasura DDN

ddn supergraph build create

This command will create builds for each connector, subgraph, and the supergraph. Each of these can be built independently but this command will create them all.

The CLI will respond with the build version, the API URL, the Console URL, the PromptQL URL, the Project Name, and a hint to browse the build on the console.

You can now use the console to explore the supergraph build by browsing to the console URL or by running ddn console --build-version <build-version> command.

The build is not yet the "official" applied API for the project. A project can have multiple builds with their own API endpoints but only one applied at a time as the "official" API.

ddn supergraph build apply <build-version>

eg:

ddn supergraph build apply 85b0961544

This build is now the "official" applied API for the project and is accessible via the API URL in the output of the command, via the console, or any client accessing via the API URL.

Summary

There are many more options and configurations available for deploying your project to Hasura DDN and we have detailed the simplest and most common flow here.