-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CLI] Custom environment variables don't work in metadata files #5691
Comments
Also doesn't work:
and
|
Should be
|
For remote schemas, the metadata doesn't support `{{ }}`` style env templating yet. Pls see this issue for that feature: #2483 |
For that the env var has to exist on the server (where hasura is running). Is there a way to only have it defined for the cli (using .env file for example) and then be replaced during the metadata apply? Like templating? |
To elaborate on @John0x' comment—we keep prod/dev/test migrations separate from the infrastructure that sets up Hasura on AWS Fargate. We also have separate remote schema URLs for prod/dev/test. We need to be able to set those URLs in the metadata without redeploying/modifying the infrastructure repository. Edit: For now, we use |
This is a very important feature for us as well. |
It's not immediately clear to me if this means that the |
I've run into this issue - is there a solution? In the
But I get the following error |
I am also having this problem. Any progress on this? |
Hi friend, you should be able to set the environment variable in the Hasura docker container, what's not working for you? |
We have a schema that is named differently in our staging environment than in production and would need to replace the schema mapping depending on environment. For this we would like the add a env-variable as the schema. We implemented this using @henningko's approach, but it has bad developer UX, as any change to the metadata requires us to ensure the metadata variables are not replaced. |
hello, can you fix this problem? |
@Maksat-luci and others, have you set the environment variable for the Hasura GraphQL Engine server container? (Remember that the server needs to know the environment variable, not the CLI.) Can you share how you are starting the HGE server, please? |
do you mean docker compos container?
|
It looks like you have the Perhaps you intended to use the |
this variable was not there at all, I added it myself, but when I added it, a bunch of errors come out that there are no tables in postgress, I try to connect bigdipper 2.0 https://docs.bigdipper.live/cosmos-based/parser/hasura
|
@Maksat-luci: Looks like it does indeed work, and that looks like an unrelated issue. Could you please open a separate discussion or ask your question on the Hasura Discord? |
I'm having this problem too, but not for URLs. I want the cron schedule to be an environment variable but this is currently not supported. |
I have a
remote_schemas.yaml
file: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:
And dropping the quotes
doesn't work either:
The text was updated successfully, but these errors were encountered: