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

add skipIfSchemaIsUnchanged flag

Open trung opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. Code is generated in every run hence force recompile other dependent code.

Describe the solution you'd like Like other codegen plugin (e.g.: openapi codegen), a flag like skipIfSchemaIsUnchanged can detect if there's any change in the schema. If yes, code is re-generated and skip otherwise.

Describe alternatives you've considered AFAK, no other way to stop the code generation.

trung avatar Aug 18 '22 13:08 trung

Calculate SHA for schema files and record to a hidden file?

Like other codegen plugin (e.g.: openapi codegen), a flag like skipIfSchemaIsUnchanged can detect if there's any change in the schema. If yes, code is re-generated and skip otherwise.

jxnu-liguobin avatar Aug 19 '22 02:08 jxnu-liguobin

Calculate SHA for schema files and record to a hidden file?

I believe that's the case for openapi codegen:

https://github.com/OpenAPITools/openapi-generator/blob/c224cf484b020a7f5997d883cf331715df3fb52a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java#L834-L843

trung avatar Aug 25 '22 12:08 trung