@graphql-codegen/cli 3.2.0 watch mode regeneration triggers on all file changes (not just files specified in config documents pattern) #9045
Labels
kind/bug
Bug :-(
stage/5-alpha-release-testing
The pull request is merged, an alpha release is available, to be tested
Which packages are impacted by your issue?
@graphql-codegen/cli
Describe the bug
In
@graphql-codegen/cli
3.2.0 watch mode regeneration is triggered by editing any file in the project. In <=3.1.0 regeneration only triggers when a file in the config’sdocuments
pattern is edited (correct me if I’m wrong!).In our projects this is triggering many regenerations, e.g. seemingly as files are written into the Next.js build folder.
This seems to be a result of #9009
Please let me know if I’m missing something! I tried passing a pattern as the
--watch
argument orwatch
config but it seems to make no difference. But IMO even if there’s a configuration workaround this was an unexpected breaking change in a minor release.Your Example Website or App
https://github.com/GrantASL19/graphql-codegen-cli-watch-regression-repro
Steps to Reproduce the Bug or Issue
npm i
npm run generate-graphql-watch
src/test.js
andsrc/graphQl/staticPage.graphql
and note that the following is output when either file changes:npm i @graphql-codegen/[email protected]
npm run generate-graphql-watch
src/test.js
andsrc/graphQl/staticPage.graphql
and note that the regeneration is only triggered whensrc/graphQl/staticPage.graphql
changes.Expected behavior
Regeneration should only trigger when I change a file specified in the config
documents
field.Screenshots or Videos
No response
Platform
@graphql-codegen/cli
version 3.2.0Codegen Config File
Additional context
No response
The text was updated successfully, but these errors were encountered: