Cloud Deployment
We will start with Hasura Cloud
Navigate to Hasura cloud and create a new project.
You should be on the project details page, copy the admin secret and GraphQL API URL and save them for later
In the
env vars
tab, we need to add a couple of entries- HASURA_GRAPHQL_JWT_SECRET - from your ./hasura/.env file
- HASURA_GRAPHQL_UNAUTHORIZED_ROLE - anonymous
In the data tab, add a Postgres DB either using Heroku or your own DB with the
PG_DATABASE_URL
environment variableNow, we set the Hasura Cloud migrations and metadata using our local setup
On our local machine run
hasura migrate apply --endpoint <Your hasura cloud Graphql URL but remove /v1/graphql> --admin-secret <admin secret from Hasura Cloud> --project hasura --all-databases
Then run
hasura metadata apply --endpoint <Your hasura cloud Graphql URL but remove /v1/graphql> --admin-secret <admin secret from Hasura Cloud> --project hasura
Your Hasura cloud instance should now be synced up with what you had locally
- Build apps and APIs 10x faster
- Built-in authorization and caching
- 8x more performant than hand-rolled APIs