Deployment and testing of the Hasura GraphQL server in the context of the Goodcity project
Run the following script to start the hasura server locally
HASURA_GRAPHQL_ADMIN_SECRET=testadminkey ./scripts/docker-run-development.sh
A sample script for deploying on an Azure Container Instance is available here
A batch of mocha tests can be used to ensure that the cloud instance of Hasura is properly configured.
The following env variables should be provided:
HASURA_GRAPHQL_HOST
HASURA_GRAPHQL_ADMIN_SECRET
Run the tests with the following command line:
npm test
A local snapshot of the expected metadata file is located in the repo.
The tests will compare the cloud configuration with the local snapshot in order to detect unplanned changes.
If changes are expected, the snapshot can be re-written by using the following command (will also run tests)
npm test:snapshot
important: Please make sure to commit the new snapshot file after updating it.
The hasura configuration file can be printed from the local snapshot through:
npm run hasura:config
That can be useful if you wish to upload the configuration to a new instance of hasura