[CLI] Custom environment variables don't work in metadata files
See original GitHub issueI have a remote_schemas.yaml
file:
- name: api
definition:
url: "{{ API_GRAPHQL_ENDPOINT }}"
timeout_seconds: 60
based on the docs here: https://hasura.io/blog/moving-from-local-development-staging-production-with-hasura/. I have the `` environment variable set, but the hasura CLI is still not happy:
❯ API_GRAPHQL_ENDPOINT=https://7asdf8.ngrok.io/graphql hasura metadata apply --admin-secret $HASURA_GRAPHQL_ADMIN_SECRET
FATA[0005] failed to apply metadata: cannot apply metadata on the database: [parse-failed] not a valid URI ($[1].remote_schemas[0].definition.url)
And dropping the quotes
url: {{ API_GRAPHQL_ENDPOINT }}
doesn’t work either:
❯ API_GRAPHQL_ENDPOINT=https://7asdf8.ngrok.io/graphql hasura metadata apply --admin-secret $HASURA_GRAPHQL_ADMIN_SECRET
FATA[0004] failed to apply metadata: cannot apply metadata on the database: yaml: invalid map key: map[interface {}]interface {}{"API_GRAPHQL_ENDPOINT":interface {}(nil)}
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Environment and Metadata — Singularity container 3.6 ...
Environment and Metadata . Environment variables are values you can set in a session, which can be used to influence the behavior of...
Read more >Build environment variables
Identify environment variables available in the build environment, set your own environment variables, and use environment variables during builds.
Read more >Setting and getting Windows environment variables from ...
To make the environment variable accessible globally you need to set it in the registry. As you've realised by just using: set NEWVAR=SOMETHING....
Read more >Environment variables in Compose
For versions older than v1.28 , it might have trouble resolving .env file with --file or COMPOSE_FILE . To work around it, it...
Read more >Environment Variables | Salesforce CLI Setup Guide
Set to true to test string replacement without actually deploying files to the org. Instead, run force:source:convert to convert the files to metadata...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is a very important feature for us as well. Any ETA for enabling it?
I’ve run into this issue - is there a solution?
In the
databases.yaml
file I need to have a dynamic url so would like to use the following:But I get the following error
Inconsistent object: environment variable 'HASURA_GRAPHQL_DATABASE_URL' not set
. It’s unclear how this should be set.