This extension deploys Hasura Graphql Engine, runs the Hasura CLI console, and syncs metadata and migrations locally.
- Tilt and a valid cluster
- The Hasura CLI installed locally
curlinstalled locally
Basic usage
load('ext://hasura', 'hasura')
hasura()This will deploy Hasura, expose it to port 8080, start the console on port 9695and expose PostgreSQL on port 5432.
It will automatically create the required Hasura files and folder in the path directory it they don't already exist.
Any modification then done through the Hasura console will be stored locally.
The extension uses the Hasura PlatyDev Helm Chart to depoy Hasura. you can deploy Hasura in another way in using the yaml parameter e.g.:
hasura(yaml=helm('./my-local-hasura-chart'))The full list of parameters accepted by hasura includes:
release_name, defaults to''pathdefaults to'.'. It will synchronise{path}/metadataand{path}/migrationswith the server through the Hasura CLI console.resource_namedefaults to'hasura'portis the host port Hasura is redirected to, defaults to8080postgres_portdefaults to5432repositoryof the Hasura image, defaults to'hasura/graphql-engine'tagof the Hasura image, defaults to'latest'hasura_secretdefaults to'hasura-dev-secret'postgresql_passworddefaults to'development-postgres-password'. Be careful: this password is persisted in the Postgres PV, so a password change while the PV already exists won't have any effect. Let's wait for this or that.yamlto define a Kubernetes resources to deploy Hasura instead of the default Helm Chart, defaults to''console, defaults toTrue. If set to false, it won't run the Hasura console locally, therefore won't apply migrations and metadata.
You may want to start the console at a different time, or with another Hasura instance that may not be managed by Tilt or the current cluster. It will try to connect to the given Hasura instance.
It will check if a project has been set locally in the path given as a parameter. If not, it will initiate it and load the existing metadata from the Hasura server.
release_name, defaults to''path, defaults to'.', is the path of your local Hasura projethasura_resource_name, defaults toNonehasura_secret, defaults to ``'hasura-dev-secret'`hasura_endpoint, defaults to'http://localhost:8080'wait_for_services, is an array of http services that will be probed until resolved successfully before starting the console, in addition to the Hasura server in itseld. Defaults to[]
load('ext://hasura', 'hasura')
load('ext://hasura', 'hasura_console')
hasura(console=False)
hasura_console(hasura_resource_name='hasura', wait_for_services=['http://another-service/healthz'])load('ext://hasura', 'hasura_console')
hasura_console(hasura_endpoint='https://my-hasura.io', hasura_secret='my-hasura-admin-secret')