mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 08:02:15 +03:00
2ee7f7d76e
### Description Adds a `metadata diff` command to show comparisons between two different sets of Hasura metadata. ``` # Show changes between server metadata and the exported metadata file: hasura metadata diff # Show changes between server metadata and that in local_metadata.yaml: hasura metadata diff local_metadata.yaml # Show changes between metadata from metadata.yaml and metadata_old.yaml: hasura metadata diff metadata.yaml metadata_old.yaml ``` Also adds a `--dry-run` flag to `metadata apply` command which will print the diff and exit rather than actually applying the metadata. ### Affected components - CLI - Docs ### Related Issues Close #3126, Close #3127 ### Solution and Design - Added `metadata_diff.go` and `metadata_diff_test.go` ### Steps to test and verify ``` hasura metadata export # Make changes to migrations/metadata.yaml hasura metadata diff ``` ### Limitations, known bugs & workarounds This is just a general-purpose diff. A more contextual diff with the understanding of metadata can be added once #3072 is merged. |
||
---|---|---|
.. | ||
assets | ||
build | ||
cmd/hasura | ||
commands | ||
migrate | ||
telemetry | ||
update | ||
util | ||
version | ||
.gitignore | ||
.realize.yaml | ||
cli_test.go | ||
cli.go | ||
CONTRIBUTING.md | ||
directory.go | ||
get.sh | ||
global_config.go | ||
Gopkg.lock | ||
Gopkg.toml | ||
Makefile | ||
README.md |
Hasura GraphQL Engine CLI
Installation
Download GraphQL Engine CLI bundled with Hasura CLI
- Linux/macOS
curl -L https://cli.hasura.io/install.sh | bash
- Windows: installer
Download using go get
go get github.com/hasura/graphql-engine/cli/cmd/hasura
Build from source
git clone https://github.com/hasura/graphql-engine
cd graphql-engine/cli
make deps
make build
# binaries will be in _output directory
Usage
hasura init --directory <my-project> --endpoint <graphql-endpoint> --admin-secret <admin-secret>
cd <my-project>
hasura console
Contributing
Checkout the contributing guide.