Support for metadata.json in cli-migrations/v3/docker-entrypoint.sh
So the hasura cli-migrations/v3 script doesnt support loading metadata.json file, only yml files in a metadata directory.
This feature is quite useful because loading JSON metadata is much faster than YML files. Also running the hasura/graphql-engine:v2.5.0.cli-migrations-v3 container wont support loading JSON metadata on start up.
There was an attempt to do this back in the old days https://github.com/hasura/graphql-engine/pull/1968
Hey, support for this was added in https://github.com/hasura/graphql-engine/commit/186baa7915a59b0ec2cb19de6a0494e60b767fa7. You can set a metadata_file variable to your config.yaml to point to a metadata json file (example). Unfortunately its not been documented well at the moment. Do let us know if this solves your issue
@rikinsk yeah... doesn't look like it works. At least not in hasura/graphql-engine:v2.5.0.cli-migrations-v3, I tried that but I still get this same error that I get when not setting up any metadata:
{
"path": "$.args.metadata",
"error": "key \\"tables\\" not found",
"code": "parse-failed"
}
More details
Im running the docker image with the `HASURA_GRAPHQL_METADATA_DIR` set to the directory where I have my metadata.json and config.yaml.config.yaml
version: 3
endpoint: http://host.docker.internal:8080
metadata_file: "metadata.json"
metadata.json
{
"version": 3,
"sources": [
{
"name": "postgres",
"kind": "postgres",
"configuration": {...},
"tables": [...]
}
]
}
@AndresPrez So it seems like we don't seem to be supporting the metadata file option in the cli-migrations image at the moment. We'll use this issue to track this missing functionality and prioritize it.
@AndresPrez So it seems like we don't seem to be supporting the metadata file option in the cli-migrations image at the moment. We'll use this issue to track this missing functionality and prioritize it.
Was tracking metadata as json ever addressed?
I'd like to know this as well, as the JSON format is more portable between environments
I'd love to have this functionality too!
Want this too, would be nice