Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

Latest commit

 

History

History

README.md

Hasura

Hasura Cloud configuration providing a unified GraphQL API over our datastores for the Catalog application.

Local Development with Docker

Prerequisites

Running Locally

  1. Set the NPM_TOKEN environment variable (retrieve from Doppler):

    export NPM_TOKEN=*npm_token*
  2. (Optional) Clear old data if needed:

    yarn dcs-local
  3. Start Hasura:

    yarn dcu-local  # Wait ~15s for full initialization (may prompt for Heroku auth)
    yarn hasura-init
    cd hasura/
    hasura console  # Opens Hasura Console in your browser

Making Schema Changes

Always make data model changes locally first, then apply as migrations to production.

  1. Edit locally: Changes made in hasura console automatically generate migration files in hasura/migrations/
  2. Review: Create a PR with your changes
  3. Apply to production after merging:
    hasura migrate apply --endpoint https://catalog-prod.hasura.app --admin-secret '*secret*'
    hasura metadata apply --endpoint https://catalog-prod.hasura.app --admin-secret '*secret*'

Note: The admin secret must be surrounded by single quotes. Find it in Doppler under catalog/prd as CATALOG_PROD_HASURA_ADMIN_SECRET.

Stopping Hasura

Two options for stopping local containers:

  • yarn dcs-local — Stops containers and removes Docker images/volumes. Use this to ensure fresh container instances on next startup.
  • yarn dcs — Stops containers only, preserving images/volumes/containers.

Note: Database backup data persists in hasura/Docker/docker-entrypoint-initdb.d/latest.dump, so yarn dcu-local typically only needs to run once per branch initialization.