- Create your heroku app without an access-key
- Initialize directory for Hasura GraphQL Engine
hasura init <app-name>
- cd into and edit config.yaml to update the endpoint
- Run pg_dump to dump the required schemas
pg_dump -h host -d database -U user --attribute-inserts -n schema1,schema2 > migrations/1_init.up.sql
- Export metadata by running:
hasura metadata export
- Commit all your changes and push to git.
- Add accounts@hasura.io as collaborator (Important)
heroku access:add accounts@hasura.io --app <app-name>
- Clone the examples-apps repo
- Reset postgresql database by running:
heroku pg:reset --app <app-name> --confirm <app-name>
- Restart the app so that graphql-engine is initialized
heroku restart --app <app-name>
- Apply the migrations by running:
hasura migrate apply
- Apply the metadata by running:
hasura metadata apply
- A README that describes your app
- A
queries.graphql
file that lists your sample GraphQL queries that GraphiQL will automatically be loaded with
# Insert author
mutation {
insert_author(objects: [{name: "natwarlal"}] {
returning {
id
}
}
}
# Query author
query {
author {
id
name
}
}
- A script will refresh all the databases every 30mins for all the example apps (it will run the migrations in the migrations directory)
- This way you can safely share the Hasura GraphQL engine link with whoever and put it wherever you want, like in your blogpost or on the Hasura website or in a forum or on quora