-
Notifications
You must be signed in to change notification settings - Fork 113
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
Environment variables don't work within the .graphqlrc.yml or .graphqlrc.json #1786
Comments
I think
|
Hi @ardatan Thanks for your comment. I also tried the YAML format. It doesn't work either. =/ The problem is that the environment variables are not being loaded into I debugged So, when I pass As I said before, the codegen command should be able to read the |
I'm having the same issue, also using a |
Any progress on this |
I also need this functionality to work in my project |
Describe the bug
Environment variables don't work within the
.graphqlrc.yml
or.graphqlrc.json
config file. We have the option to pass--require dotenv/config
to the codegen command, but it doesn't work because codegen will only attempt to load the config file if it was not loaded before by graphql-cli. It would be nice if the graphql-cli could also read the--require
parameter to load the specified modules before loading the configuration.To Reproduce
.env
.graphqlrc.json
Command line
Result: Environment variables are loaded as
undefined
.Expected behavior
Environment variables should be loaded with the correct values from the .env file.
Versions (please complete the following information):
OS X Big Sur
graphql-cli
:4.1.0
graphql
:15.5.0
@graphql-cli/codegen
:1.17.21
@graphql-codegen/schema-ast
:1.18.1
dotenv
:8.2.0
The text was updated successfully, but these errors were encountered: