Skip to content

Commit

Permalink
Clarify supergraph build workflow including common pitfalls (#714)
Browse files Browse the repository at this point in the history
  • Loading branch information
nullxone authored Oct 18, 2024
1 parent 1ac9564 commit dcf0b48
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions docs/getting-started/build/04-build-your-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,28 @@ a GraphQL query on your API using any models you've added.

### Step 1. Create a supergraph build

```bash title="Run the following command, updating the referenced paths to match your directory structure:"
```bash title="Run:"
ddn supergraph build local
```

This will create a build of your supergraph located in the `/engine/build` directory.

:::tip Start your engines!
### Step 2. Start your engines!

Want to test your supergraph? Make sure that your services are still up and running with the following command.
If you are already running this command, first stop the command with `CTRL+C`. Then run the command to start the connector and engine services with the updated configurations.

```bash title="Run:"
ddn run docker-start
```

**If you haven't [included your connector(s)](/getting-started/build/03-connect-to-data/01-connect-a-source.mdx) in your
`compose.yaml`, don't forget to start it as well.**
:::tip Port conflicts?

Stop any previously running `ddn run docker-start` commands in your terminal. Existing running servers can conflict with the ports needed. In particular, engine always starts on port 3000.

:::

### Step 3. Launch the Hasura console

You can check out your local API by launching the Hasura console using the CLI.

```bash title="Run:"
Expand All @@ -77,7 +80,7 @@ browsers for the best experience with the Hasura Console including for local dev

:::

### Step 2. Write your first query
### Step 4. Write your first query

Use the GraphiQL explorer to either write a query or construct it using the menu on the left-hand side of the console.
When you're ready, hit the run button to execute your query.
Expand All @@ -92,8 +95,7 @@ query MyFirstQuery {
}
```

All types are namespaced with the subgraph to which they belong. Here, you can see that `carts` belongs to a subgraph
named `my_subgraph`. Thus, the query above will return a response that looks like this:
The above query will return a response that looks like this:

![Simple query with carts](/img/get-started/beta/console_simple-carts-query.png)

Expand Down

0 comments on commit dcf0b48

Please sign in to comment.