https://github.com/subsquid/hasura-configuration
Hasura configuration tool for use in SQD indexers
https://github.com/subsquid/hasura-configuration
Last synced: 4 months ago
JSON representation
Hasura configuration tool for use in SQD indexers
- Host: GitHub
- URL: https://github.com/subsquid/hasura-configuration
- Owner: subsquid
- Created: 2024-08-09T11:43:28.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-02-22T00:06:57.000Z (over 1 year ago)
- Last Synced: 2025-04-02T06:11:20.452Z (about 1 year ago)
- Language: TypeScript
- Size: 73.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @subsquid/hasura-configuration
> [!NOTE]
> For info on migrating to v2 of the tool see [this page](https://docs.sqd.ai/sdk/resources/migrate/migrate-to-hasura-configuration-tool-v2).
A tool that configures Hasura to track all database tables that have [TypeORM models](https://docs.devsquid.net/sdk/reference/schema-file/intro/#typeorm-codegen) in [SQD indexers](https://docs.subsquid.io/sdk).
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
```bash
# 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`