@@ -87,6 +87,8 @@ public class GraphQLCodegenGradleTask extends DefaultTask implements GraphQLCode
8787 private Set <String > fieldsWithResolvers = new HashSet <>();
8888 private Set <String > fieldsWithoutResolvers = new HashSet <>();
8989 private Set <String > typesAsInterfaces = new HashSet <>();
90+ private Set <String > resolverArgumentAnnotations = new HashSet <>();
91+ private Set <String > parametrizedResolverAnnotations = new HashSet <>();
9092 private final RelayConfig relayConfig = new RelayConfig ();
9193
9294
@@ -109,6 +111,8 @@ public class GraphQLCodegenGradleTask extends DefaultTask implements GraphQLCode
109111 private Boolean supportUnknownFields = MappingConfigConstants .DEFAULT_SUPPORT_UNKNOWN_FIELDS ;
110112 private String unknownFieldsPropertyName = MappingConfigConstants .DEFAULT_UNKNOWN_FIELDS_PROPERTY_NAME ;
111113
114+ private Boolean skip = false ;
115+
112116 public GraphQLCodegenGradleTask () {
113117 setGroup ("codegen" );
114118 setDescription ("Generates Java POJOs and interfaces based on GraphQL schemas" );
@@ -164,6 +168,10 @@ public void generate() throws Exception {
164168 fieldsWithoutResolvers != null ? fieldsWithoutResolvers : new HashSet <>());
165169 mappingConfig .setTypesAsInterfaces (
166170 typesAsInterfaces != null ? typesAsInterfaces : new HashSet <>());
171+ mappingConfig .setResolverArgumentAnnotations (
172+ resolverArgumentAnnotations != null ? resolverArgumentAnnotations : new HashSet <>());
173+ mappingConfig .setParametrizedResolverAnnotations (
174+ parametrizedResolverAnnotations != null ? parametrizedResolverAnnotations : new HashSet <>());
167175 mappingConfig .setRelayConfig (relayConfig );
168176
169177 mappingConfig .setGenerateClient (generateClient );
@@ -188,6 +196,11 @@ public void generate() throws Exception {
188196 mappingConfig .setSupportUnknownFields (isSupportUnknownFields ());
189197 mappingConfig .setUnknownFieldsPropertyName (getUnknownFieldsPropertyName ());
190198
199+ if (Boolean .TRUE .equals (skip )) {
200+ getLogger ().info ("Skipping code generation" );
201+ return ;
202+ }
203+
191204 instantiateCodegen (mappingConfig ).generate ();
192205 }
193206
@@ -689,6 +702,28 @@ public void setTypesAsInterfaces(Set<String> typesAsInterfaces) {
689702 this .typesAsInterfaces = typesAsInterfaces ;
690703 }
691704
705+ @ Input
706+ @ Optional
707+ @ Override
708+ public Set <String > getResolverArgumentAnnotations () {
709+ return resolverArgumentAnnotations ;
710+ }
711+
712+ public void setResolverArgumentAnnotations (Set <String > resolverArgumentAnnotations ) {
713+ this .resolverArgumentAnnotations = resolverArgumentAnnotations ;
714+ }
715+
716+ @ Input
717+ @ Optional
718+ @ Override
719+ public Set <String > getParametrizedResolverAnnotations () {
720+ return parametrizedResolverAnnotations ;
721+ }
722+
723+ public void setParametrizedResolverAnnotations (Set <String > parametrizedResolverAnnotations ) {
724+ this .parametrizedResolverAnnotations = parametrizedResolverAnnotations ;
725+ }
726+
692727 @ Nested
693728 @ Optional
694729 @ Override
@@ -897,6 +932,15 @@ public String getUnknownFieldsPropertyName() {
897932 public void setUnknownFieldsPropertyName (String unknownFieldsPropertyName ) {
898933 this .unknownFieldsPropertyName = unknownFieldsPropertyName ;
899934 }
900-
935+
936+ @ Input
937+ @ Optional
938+ public Boolean isSkip () {
939+ return skip ;
940+ }
941+
942+ public void setSkip (Boolean skip ) {
943+ this .skip = skip ;
944+ }
901945
902946}
0 commit comments