graphql-codegen-vscode icon indicating copy to clipboard operation
graphql-codegen-vscode copied to clipboard

Doesn't work with dotenv/config

Open depsimon opened this issue 2 years ago • 2 comments

I'm using an environment variable to specify the schema path and I can't specify that in the extension.

Example script from my package.json

"gql:generate": "graphql-codegen --config codegen.yml -r dotenv/config"

depsimon avatar Apr 07 '22 06:04 depsimon

This could be solved by having a configuration for the extension that allows you to add to the command line used. Without it, it's not very useful. Using environment variables in codegen.yaml is not exactly an edge case.

johnschult avatar Jul 08 '22 13:07 johnschult

This is big. I see two possible solutions:

  • Supporting dotenv out-of-the-box - which would be great.
  • Allowing to specify a custom codegen script command (like running gql:generate in the example provided by @depsimon).

For now I'm going with this extension - even though I had to manually source the shell..

robertherber avatar Aug 20 '22 11:08 robertherber