-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Smarter watch #5642
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
Comments
Totally agree here. We try to watch specific files by default (without the |
Note: Source: #2872 (comment) |
Also just ran into this issue—would be nice to have this supported as it's inefficient to introspect an API endpoint every time (vs. introspecting to local once) Tried to use projects but not super clear |
We now have watchPattern:
Please let me know if it does not solve the issue. 🙂 |
Is your feature request related to a problem? Please describe.
Currently when using the
--watch
mode, every project/plugin is run, no matter the file that changed. I think it could be optimized.Describe the solution you'd like
The most flexible solution would be to provide a
watch
glob to eachgenerates
block in the config so we can target specific files.I also think some plugin such as
typescript-operations
could be optimized and exit early (and silently) if there was no change detected in the edited file. For example when I edit a file containing no graphql operation (so no gql-tag use) I expect the plugin to do nothing in watch mode. Right now it's regenerating all the operations.So internally graphql-codegen would need to pass only the edited file to the plugin during watch mode.
Describe alternatives you've considered
Right now I'm doing it manually by splitting my configuration into multiple projects and using
chokidar-cli
in my scripts :Additional context
The text was updated successfully, but these errors were encountered: