Skip to content

Commit

Permalink
Merge pull request #341 from aura-nw/feat/create-hasura-metadata-merg…
Browse files Browse the repository at this point in the history
…e-develop

feat: manage hasura metadata (develop)
  • Loading branch information
fibonacci998 authored Aug 25, 2023
2 parents 5f9a54a + bd0d8c7 commit 02aae23
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .env.hasura.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Use for hasura cli
HASURA_GRAPHQL_VERSION=3
HASURA_GRAPHQL_ENDPOINT=
HASURA_GRAPHQL_ADMIN_SECRET=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ typings/

# dotenv environment variables file
.env
.env.hasura

# next.js build output
.next
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM node:16-alpine

## Install hasura cli
RUN apk update && apk add bash curl && curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash

# Working directory
WORKDIR /app

Expand Down
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,36 @@ then start service

```
# create file env
cp .env.example .env
cp .env.sample .env
# run with moleculer cli
npm run dev
```

### Hasura metadata migration

Read [link](https://hasura.io/docs/latest/hasura-cli/install-hasura-cli/) to install Hasura CLI for your operating system. To make update to hasura metadata programmatically, use sample code below:

```
# init hasura directory
hasura init hasura
# create file env hasura
cp .env.hasura.sample hasura/.env
# go to hasura directory
cd hasura
# export current metadata from hasura
hasura metadata export
# check current diff between local and hasura server
hasura metadata diff
# apply current hasura metadata to server
hasura metadata apply
```

## Configuration

[Config Moleculer](.env.sample), refer [docs](https://moleculer.services/docs/0.14/configuration.html) to get detail configurations
Expand Down

0 comments on commit 02aae23

Please sign in to comment.