Skip to content

Commit

Permalink
update readme and cleanup dockerfile (#109)
Browse files Browse the repository at this point in the history
* update readme with connect db step

* remove extra lines from dockerfile
  • Loading branch information
rikinsk authored Feb 4, 2022
1 parent da63f74 commit 4d05bec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
13 changes: 0 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,7 @@ ENV HASURA_GRAPHQL_DEV_MODE=true
# https://devcenter.heroku.com/articles/heroku-postgres-plans#hobby-tier
ENV HASURA_GRAPHQL_PG_CONNECTIONS=15

# Change $DATABASE_URL to your heroku postgres URL if you're not using
# the primary postgres instance in your app
CMD HASURA_GRAPHQL_METADATA_DATABASE_URL=$DATABASE_URL graphql-engine \
serve \
--server-port $PORT

## Comment the command above and use the command below to
## enable an access-key and an auth-hook
## Recommended that you set the access-key as a environment variable in heroku
#CMD graphql-engine \
# --database-url $DATABASE_URL \
# serve \
# --server-port $PORT \
# --access-key XXXXX \
# --auth-hook https://myapp.com/hasura-webhook
#
# Console can be enable/disabled by the env var HASURA_GRAPHQL_ENABLE_CONSOLE
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,19 @@ Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?
### 2. Open Hasura Console

Once the deployment is complete, click on the `View` button as marked above.
This will take you to the Hasura Console, where you can create a table and make
This will take you to the Hasura Console, where you can connect your database, create a table and make
your first GraphQL query.

![Hasura Console](https://graphql-engine-cdn.hasura.io/heroku-repo/assets/hasura_console.png)

### 3. Create a table
### 3. Connect a database

Head to the `Data` tab on the console and connect your database. If you do not have an existing database, you can connect to the
Heroku Postgres database that was set up with your deployment using the `DATABASE_URL` env var.

![heroku_connect_db](https://graphql-engine-cdn.hasura.io/heroku-repo/assets/heroku_connect_db.png)

### 4. Create a table

Navigate to `Data -> Create table` on the console and create a table called
`profile` with the following columns:
Expand All @@ -50,7 +57,7 @@ Choose `id` as the Primary key and click the `Create` button.

![Hasura Console - Create table](https://graphql-engine-cdn.hasura.io/heroku-repo/assets/hasura_create_table.png)

### 4. Insert sample data
### 5. Insert sample data

Once the table is created, go to the `Insert Row` tab and insert some sample
rows:
Expand All @@ -64,7 +71,7 @@ Black Widow

![Hasura Console - Insert rows](https://graphql-engine-cdn.hasura.io/heroku-repo/assets/hasura_insert_row.png)

### 5. Try out GraphQL
### 6. Try out GraphQL

Switch to the `GraphiQL` tab on top and execute the following GraphQL query:

Expand Down
Binary file added assets/heroku_connect_db.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4d05bec

Please sign in to comment.