Skip to content

Commit 286c6b1

Browse files
authored
Automatically disable parameterized constructor for large types with >255 fields (#817)
1 parent 42416cc commit 286c6b1

File tree

4 files changed

+1
-4
lines changed

4 files changed

+1
-4
lines changed

graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/java/DataTypeGenerator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ abstract class BaseDataTypeGenerator(
393393

394394
addDefaultConstructor(javaType)
395395

396-
if (config.javaGenerateAllConstructor && fields.isNotEmpty()) {
396+
if (config.javaGenerateAllConstructor && fields.isNotEmpty() && fields.size < 256) {
397397
addParameterizedConstructor(fields, javaType)
398398
}
399399

graphql-dgs-codegen-gradle/src/test/resources/test-project/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ generateJava {
3232
generatedSourcesDir = "${projectDir}/build/graphql"
3333
typeMapping = [Date:"java.time.LocalDateTime"]
3434
generateDocs = true
35-
javaGenerateAllConstructor = false
3635
}
3736

3837
codegen.clientCoreConventionsEnabled = false

graphql-dgs-codegen-gradle/src/test/resources/test-project/build_omit_null_input_fields.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ generateJava {
3434
generateClient = true
3535
generateDataTypes = true
3636
generateDocs = true
37-
javaGenerateAllConstructor = false
3837
}
3938

4039
codegen.clientCoreConventionsEnabled = false

graphql-dgs-codegen-gradle/src/test/resources/test-project/build_with_default_dir.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ generateJava {
3030
schemaPaths = ["${projectDir}/src/main/resources/schema"]
3131
packageName = 'com.netflix.testproject.graphql'
3232
typeMapping = [Date:"java.time.LocalDateTime"]
33-
javaGenerateAllConstructor = false
3433
// no generated sources dir specified
3534
}
3635

0 commit comments

Comments
 (0)