Graphql-code-generator: Using CLI with watch option doesn't reload configuration

Created on 30 Nov 2020  路  6Comments  路  Source: dotansimha/graphql-code-generator

Describe the bug
When using the CLI with the watch option I'd expect the configuration file to be reloaded. I just spent an hour figuring out why my newly added typeMappings didn't update - only to realise the config was never reloaded.

To Reproduce
Steps to reproduce the behavior:

  1. Use any working codegen.yml/schema setup.
  2. Run graphql-codegen --config codegen.yml --watch my-schema.graphql
  3. Make a change in codegen.yml
  4. Make a change in my-schema.graphql

Expected behavior
I'd expect the changes in step 3 to be reflected in the generated result.

bug core waiting-for-release

All 6 comments

Thank you for reporting this @robertherber . This seems related: https://github.com/dotansimha/graphql-code-generator/issues/1735
Maybe the comment there might be relevant as well.

@dotansimha Indeed - seems like the issue has resurfaced again.

I can add that my current solution is using nodemon instead which works well as a workaround.

@robertherber is there a chance you know which version you had before and if it worked? just so it will be easier to track what caused it. Thank you!

@dotansimha I'm not sure if it's worked for me before - this happened in a new project. The reason I suppose it's been working in between is simply because of the related issue.. :)

@gilgardosh fixed it in https://github.com/dotansimha/graphql-code-generator/pull/5209 , and it's available now in @graphql-codegen/[email protected]. Thanks!

Was this page helpful?
0 / 5 - 0 ratings