Hasura add-on
Running Hasura
To provision a Hasura instance, add an empty deploy.addons.hasura
section to the deployment manifest. Provide some basic configuration via the environment variables:
deploy:
env:
HASURA_GRAPHQL_ADMIN_SECRET: "${{ secrets.HASURA_SECRET }}"
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: user
HASURA_GRAPHQL_STRINGIFY_NUMERIC_TYPES: "true"
addons:
postgres:
hasura:
Note the use of a Cloud secret for storing the admin password.
Configuring a Hasura API
Using with a squid
If you're using Hasura with a squid that writes its data to PostgreSQL, you will need to configure the API manually. For basic table queries:
-
Visit the Hasura console using the API link from your squid's page in the Cloud app.
-
Navigate to
Data > Data Manager > Databases > default > public
and clickTrack
for all tables you would like to expose over your API. -
Observe the schema change at
API > GraphiQL
.
Using with a DipDup indexer
DipDup configures Hasura automatically. See the DipDup section for details.