@subsquid/hasura-configuration
v1.0.2
Published
Hasura configuration tool for use in SQD indexers
Downloads
3
Readme
@subsquid/hasura-configuration
A tool that configures Hasura to track all database tables that have TypeORM models in SQD indexers.
The configuration is saved to a file compatible with the standard Hasura import / export procedure ("Settings > Metadata Actions" in the web GUI). You can edit it in the GUI, export it, then apply it after it is erased (e.g. when the Hasura container is recreated).
Usage
# 1. Install
npm i @subsquid/hasura-configuration
# 2. List available commands
npx squid-hasura-configuration --help
apply Apply the configuration at hasura_metadata.json
regenerate Analyze TypeORM models and generate a Hasura configuration
at hasura_metadata.json that tracks all related tables and
foreign key relationships
The apply
command takes Hasura connection settings from environment variables:
HASURA_GRAPHQL_ENDPOINT
(default:http://localhost:8080
)HASURA_GRAPHQL_ADMIN_SECRET