heftapp / graphql_codegen

MIT License
143 stars 53 forks source link

Option to disable CopyWith generation #352

Closed sigis151 closed 1 month ago

sigis151 commented 3 months ago

is there abitily to disable CopyWith methods generation to reduce generation time?

github-actions[bot] commented 3 months ago

👋 @sigis151 Thank you for raising an issue. I will investigate the issue and get back to you as soon as possible. Please make sure you have provided enough context.

This library is created and maintained by me, @budde377. Please consider supporting my work and ensure our survival by donating here.

budde377 commented 3 months ago

Thanks for reaching out @sigis151 - before we consider this, I would like to understand your setup better. What kind of generation times are you seeing and how many GraphQL files are you generating?

sigis151 commented 3 months ago

Hi, we have around ±100 different queries in the project and it can take up to a minute to rebuild (dart run build_runner build --delete-conflicting-outputs) all generated files, and as we re-map all gql responses to our own domain classes I don't see any real need for copy methods that are generated :)

budde377 commented 1 month ago

I've added the disableCopyWithGeneration. Setting this to true will disable copy-with generation.

sigis151 commented 1 month ago

Do when statements depend on CopyWith as those are also disabled with disableCopyWithGeneration?

budde377 commented 1 month ago

Those should be added back again in 1.0.1.