Skip to main content
Version: v3.x beta

Projects

Introduction

Broadly, a project is the configuration of your data supergraph.

A project specifies manifests, each of which specify supergraph and subgraph configurations that are used create builds which are snapshots of the project config and are used to serve your API.

Initialize a Project

We can create a new project on Hasura DDN and scaffold out the metadata locally using the Hasura CLI.

Login to Hasura DDN

In order to create a project, you need to be logged into Hasura DDN. You can do this in two ways:

  • Via the browser (recommended)
  • Using a Personal Access Token (PAT)

Browser

ddn login

This will launch a browser window and prompt you to login to your Hasura DDN account. Once you've logged in, you can close the browser window and return to your terminal.

PAT

Alternatively, you can use a PAT to authenticate with the CLI.

You can create a PAT by navigating to the Access Tokens page in your account settings. Where you can create a new token and copy the value.

Back in the Hasura CLI, run:

ddn login --pat <PAT>

You should see a confirmation that you're now successfully logged in, and can now create a new project.

Create a new project

ddn create project --dir ./<DIR>

Configure a project

This will create a new project on Hasura DDN and scaffold out the necessary configuration files in the directory you specified.

For more information on the project configuration files, see the configuration section.

Create builds

In order to see configurations in your metadata take effect you need to create a build. Head over to the Builds section to learn about how to create and manage builds.

Alternatively, during development, you can use dev mode to automatically create builds when changes are detected in your project.

Get a project

You can get the relevant information of your project in the current directory by using the CLI and running:

ddn get project

You will see an output similar to the following:

+-------------+----------------------------------------------------------------+
| Name | stunning-eagle-6335 |
+-------------+----------------------------------------------------------------+
| ID | 3172bf76-1d6f-4869-9ee2-7147b964cc5e |
+-------------+----------------------------------------------------------------+
| Console URL | https://console.arusah.com/project/stunning-eagle-6335/graphql |
+-------------+----------------------------------------------------------------+
| Build Count | 14 |
+-------------+----------------------------------------------------------------+
| Domain | |
+-------------+----------------------------------------------------------------+
Running from a non-project directory

If you've installed the CLI globally and are running the command from a directory that is not a project directory, you will see all the projects you have access to.

Delete a project

You can delete a project using the CLI by running:

ddn project delete
Loading...