From 8003b1b77fe48356456edd232aacff0c9ab83956 Mon Sep 17 00:00:00 2001 From: Damian Wilkolek Date: Fri, 19 Apr 2024 00:44:25 +0200 Subject: [PATCH 1/3] feat: allow to set default InputValueSerializer #455 --- .../dgs/codegen/cases/input/test/QueryTest.kt | 71 +++++++++++++++++++ .../graphql/dgs/codegen/Kotlin2Core.kt | 22 ++++-- .../codegen/InputValueSerializerTest.kt | 11 +++ 3 files changed, 100 insertions(+), 4 deletions(-) diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/test/QueryTest.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/test/QueryTest.kt index dcc4d9e2c..8281b2648 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/test/QueryTest.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/test/QueryTest.kt @@ -18,12 +18,34 @@ package com.netflix.graphql.dgs.codegen.cases.input.test +import com.netflix.graphql.dgs.client.codegen.InputValueSerializer +import com.netflix.graphql.dgs.codegen.InputValueSerializerProvider import com.netflix.graphql.dgs.codegen.cases.input.expected.DgsClient import com.netflix.graphql.dgs.codegen.cases.input.expected.types.MovieFilter +import graphql.language.StringValue +import graphql.language.Value +import graphql.schema.Coercing import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test class QueryTest { + private val movieCoercing = object : Coercing { + override fun serialize(filter: Any): String { + return (filter as? MovieFilter)?.genre ?: "" + } + + override fun parseValue(input: Any): MovieFilter { + return MovieFilter(input.toString()) + } + + override fun parseLiteral(input: Any): MovieFilter { + return MovieFilter(input.toString()) + } + + override fun valueToLiteral(input: Any): Value<*> { + return StringValue.of(serialize(input)) + } + } @Test fun testQueryWithNoFilter() { @@ -109,4 +131,53 @@ class QueryTest { query ) } + + @Test + fun testQueryWithFilterAndCustomCoercing() { + try { + InputValueSerializerProvider.serializer = InputValueSerializer( + mapOf(MovieFilter::class.java to movieCoercing) + ) + val query = DgsClient.buildQuery { + movies(filter = MovieFilter(genre = "horror")) + } + + Assertions.assertEquals( + """{ + | __typename + | movies(filter: "horror") + |} + | + """.trimMargin(), + query + ) + } finally { + InputValueSerializerProvider.reset() + } + } + + @Test + fun testResetInputValueSerializerProvider() { + try { + InputValueSerializerProvider.serializer = InputValueSerializer( + mapOf(MovieFilter::class.java to movieCoercing) + ) + InputValueSerializerProvider.reset() + + val query = DgsClient.buildQuery { + movies(filter = MovieFilter(genre = "horror")) + } + Assertions.assertEquals( + """{ + | __typename + | movies(filter: {genre : "horror"}) + |} + | + """.trimMargin(), + query + ) + } finally { + InputValueSerializerProvider.reset() + } + } } diff --git a/graphql-dgs-codegen-shared-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/Kotlin2Core.kt b/graphql-dgs-codegen-shared-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/Kotlin2Core.kt index 10131e10f..1cc5359cf 100644 --- a/graphql-dgs-codegen-shared-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/Kotlin2Core.kt +++ b/graphql-dgs-codegen-shared-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/Kotlin2Core.kt @@ -20,6 +20,7 @@ package com.netflix.graphql.dgs.codegen import com.netflix.graphql.dgs.client.codegen.InputValue import com.netflix.graphql.dgs.client.codegen.InputValueSerializer +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import graphql.language.Argument import graphql.language.AstPrinter import graphql.language.Document @@ -50,13 +51,26 @@ object DefaultTracker { } } +object InputValueSerializerProvider { + private val default: ThreadLocal = ThreadLocal.withInitial { InputValueSerializer() } + + var serializer + get(): InputValueSerializerInterface = default.get() + set(value) = default.set(value) + + fun reset() { + serializer = InputValueSerializer() + } +} + @QueryProjectionMarker -abstract class GraphQLProjection(defaultFields: Set = setOf("__typename")) { +abstract class GraphQLProjection( + defaultFields: Set = setOf("__typename"), + private val inputValueSerializer: InputValueSerializerInterface = InputValueSerializerProvider.serializer +) { companion object { - private val inputSerializer = InputValueSerializer() - @JvmStatic protected fun default0(arg: String): T? { DefaultTracker.add(this::class.qualifiedName!!, arg) @@ -105,7 +119,7 @@ abstract class GraphQLProjection(defaultFields: Set = setOf("__typename" .map { (arg, value) -> Argument.newArgument() .name(arg) - .value(inputSerializer.toValue(value)) + .value(inputValueSerializer.toValue(value)) .build() } } diff --git a/graphql-dgs-codegen-shared-core/src/test/kotlin/com/netflix/graphql/dgs/client/codegen/InputValueSerializerTest.kt b/graphql-dgs-codegen-shared-core/src/test/kotlin/com/netflix/graphql/dgs/client/codegen/InputValueSerializerTest.kt index 59897eab4..c3f59baca 100644 --- a/graphql-dgs-codegen-shared-core/src/test/kotlin/com/netflix/graphql/dgs/client/codegen/InputValueSerializerTest.kt +++ b/graphql-dgs-codegen-shared-core/src/test/kotlin/com/netflix/graphql/dgs/client/codegen/InputValueSerializerTest.kt @@ -16,10 +16,12 @@ package com.netflix.graphql.dgs.client.codegen +import graphql.scalars.id.UUIDScalar import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import java.time.LocalDate import java.time.LocalDateTime +import java.util.UUID class InputValueSerializerTest { @@ -151,6 +153,15 @@ class InputValueSerializerTest { assertThat(serialize).isEqualTo("ACTION") } + @Test + fun `UUID value`() { + val expected = UUID.randomUUID() + val actual = InputValueSerializer( + mapOf(UUID::class.java to UUIDScalar.INSTANCE.coercing) + ).serialize(expected) + assertThat(actual).isEqualTo(""""$expected"""") + } + @Test fun `overridden properties are serialized`() { abstract class Base { From a14ecabfffaff9fd0f319359750b3f245f150f46 Mon Sep 17 00:00:00 2001 From: Matt Bossenbroek Date: Fri, 19 Apr 2024 15:24:53 -0700 Subject: [PATCH 2/3] Explicitly pass optional inputValueSerializer through kotlin2 projections --- .../expected/DgsClient.kt | 7 ++- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../expected/DgsClient.kt | 7 ++- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../expected/DgsClient.kt | 7 ++- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../expected/DgsClient.kt | 7 ++- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 9 ++- .../expected/DgsClient.kt | 7 ++- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../cases/dataClassDocs/expected/DgsClient.kt | 7 ++- .../expected/client/MovieProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 8 ++- .../dataClassFieldDocs/expected/DgsClient.kt | 7 ++- .../expected/client/MovieProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 8 ++- .../expected/DgsClient.kt | 7 ++- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../expected/DgsClient.kt | 7 ++- .../expected/client/QueryProjection.kt | 7 ++- .../client/RequiredTestTypeProjection.kt | 5 +- .../expected/DgsClient.kt | 7 ++- .../client/EntityConnectionProjection.kt | 9 ++- .../expected/client/EntityEdgeProjection.kt | 7 ++- .../expected/client/EntityProjection.kt | 5 +- .../expected/client/PageInfoProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 9 ++- .../expected/DgsClient.kt | 7 ++- .../expected/client/CarProjection.kt | 7 ++- .../expected/client/EngineProjection.kt | 7 ++- .../expected/client/PerformanceProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../expected/DgsClient.kt | 7 ++- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../expected/DgsClient.kt | 7 ++- .../expected/client/EmployeeProjection.kt | 5 +- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../expected/DgsClient.kt | 7 ++- .../expected/client/EmployeeProjection.kt | 5 +- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../expected/client/TalentProjection.kt | 5 +- .../expected/DgsClient.kt | 7 ++- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../expected/DgsClient.kt | 7 ++- .../expected/client/EntityProjection.kt | 5 +- .../expected/client/NodeProjection.kt | 5 +- .../expected/client/ProductProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../expected/DgsClient.kt | 7 ++- .../client/EntityConnectionProjection.kt | 9 ++- .../expected/client/EntityEdgeProjection.kt | 7 ++- .../expected/client/EntityProjection.kt | 5 +- .../expected/client/PageInfoProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 9 ++- .../expected/DgsClient.kt | 7 ++- .../expected/client/EmployeeProjection.kt | 5 +- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../expected/client/MyTypeProjection.kt | 7 ++- .../expected/client/OtherTypeProjection.kt | 5 +- .../expected/DgsClient.kt | 7 ++- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../expected/client/MyTypeProjection.kt | 5 +- .../expected/client/MyTypeProjection.kt | 5 +- .../expected/DgsClient.kt | 7 ++- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../expected/client/MyTypeProjection.kt | 5 +- .../expected/DgsClient.kt | 7 ++- .../expected/client/PersonProjection.kt | 7 ++- .../expected/client/QueryProjection.kt | 7 ++- .../expected/client/SampleTypeProjection.kt | 5 +- .../expected/DgsClient.kt | 7 ++- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../codegen/cases/enum/expected/DgsClient.kt | 7 ++- .../enum/expected/client/QueryProjection.kt | 5 +- .../expected/DgsClient.kt | 7 ++- .../expected/client/QueryProjection.kt | 5 +- .../codegen/cases/input/expected/DgsClient.kt | 7 ++- .../input/expected/client/QueryProjection.kt | 5 +- .../dgs/codegen/cases/input/test/QueryTest.kt | 59 +++++-------------- .../expected/DgsClient.kt | 7 ++- .../expected/client/QueryProjection.kt | 5 +- .../expected/client/BirdProjection.kt | 11 ++-- .../expected/client/DogProjection.kt | 11 ++-- .../expected/client/PetProjection.kt | 11 ++-- .../expected/client/DietProjection.kt | 5 +- .../expected/client/DogProjection.kt | 7 ++- .../expected/client/PetProjection.kt | 7 ++- .../expected/client/VegetarianProjection.kt | 5 +- .../expected/DgsClient.kt | 7 ++- .../expected/client/EmployeeProjection.kt | 5 +- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../expected/client/TitledProjection.kt | 5 +- .../expected/client/TitledProjection.kt | 5 +- .../expected/DgsClient.kt | 7 ++- .../expected/client/FruitProjection.kt | 7 ++- .../expected/client/QueryProjection.kt | 7 ++- .../expected/client/SeedProjection.kt | 5 +- .../expected/client/StoneFruitProjection.kt | 7 ++- .../projectionWithEnum/expected/DgsClient.kt | 7 ++- .../expected/client/QueryProjection.kt | 5 +- .../expected/DgsClient.kt | 7 ++- .../expected/client/QueryProjection.kt | 5 +- .../expected/DgsClient.kt | 7 ++- .../expected/client/QueryProjection.kt | 5 +- .../expected/DgsClient.kt | 7 ++- .../expected/client/QueryProjection.kt | 5 +- .../projectionWithType/expected/DgsClient.kt | 7 ++- .../expected/client/EmployeeProjection.kt | 5 +- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 9 ++- .../expected/DgsClient.kt | 7 ++- .../expected/client/EmployeeProjection.kt | 5 +- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 8 ++- .../projectionWithUnion/expected/DgsClient.kt | 7 ++- .../expected/client/EmployeeProjection.kt | 5 +- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 9 ++- .../expected/client/UProjection.kt | 5 +- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/PersonProjection.kt | 5 +- .../expected/client/PersonProjection.kt | 5 +- .../codegen/cases/union/expected/DgsClient.kt | 7 ++- .../union/expected/client/ActorProjection.kt | 5 +- .../union/expected/client/MovieProjection.kt | 5 +- .../union/expected/client/QueryProjection.kt | 7 ++- .../expected/client/SearchResultProjection.kt | 5 +- .../expected/DgsClient.kt | 7 ++- .../expected/client/DroidProjection.kt | 5 +- .../expected/client/HumanProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../client/SearchResultPageProjection.kt | 7 ++- .../expected/client/SearchResultProjection.kt | 5 +- .../expected/DgsClient.kt | 7 ++- .../expected/client/ActorProjection.kt | 5 +- .../expected/client/MovieProjection.kt | 5 +- .../expected/client/QueryProjection.kt | 7 ++- .../expected/client/RatingProjection.kt | 5 +- .../expected/client/SearchResultProjection.kt | 5 +- .../kotlin2/GenerateKotlin2ClientTypes.kt | 15 ++++- .../graphql/dgs/codegen/Kotlin2Core.kt | 18 ++---- 156 files changed, 744 insertions(+), 310 deletions(-) diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/DgsClient.kt index 8593f77d2..b65854b90 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.constantsForInputTypes.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.constantsForInputTypes.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/client/PersonProjection.kt index 6d882a923..15f63ddde 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.constantsForInputTypes.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: PersonProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/client/QueryProjection.kt index a62032cc8..187df02b3 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/client/QueryProjection.kt @@ -1,12 +1,15 @@ package com.netflix.graphql.dgs.codegen.cases.constantsForInputTypes.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.constantsForInputTypes.expected.types.PersonFilter -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(filter: PersonFilter? = default("filter"), _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("people", PersonProjection(), _projection, "filter" to filter) + field("people", PersonProjection(inputValueSerializer), _projection, "filter" to filter) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/DgsClient.kt index 64fdf6bc1..a14ef3448 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedInputTypes.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedInputTypes.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/client/PersonProjection.kt index b3f92b267..7fce836c4 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedInputTypes.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: PersonProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/client/QueryProjection.kt index a3a1f28b0..ad3c11f36 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/client/QueryProjection.kt @@ -1,12 +1,15 @@ package com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedInputTypes.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedInputTypes.expected.types.PersonFilter -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(filter: PersonFilter? = default("filter"), _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("people", PersonProjection(), _projection, "filter" to filter) + field("people", PersonProjection(inputValueSerializer), _projection, "filter" to filter) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInterface/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInterface/expected/DgsClient.kt index 852fd2ff7..77eaca230 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInterface/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInterface/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedInterface.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedInterface.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInterface/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInterface/expected/client/PersonProjection.kt index 2964f5451..fe830d317 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInterface/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInterface/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedInterface.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: PersonProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInterface/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInterface/expected/client/QueryProjection.kt index 8e4bd0a10..5ea7f2f30 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInterface/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInterface/expected/client/QueryProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedInterface.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("people", PersonProjection(), _projection) + field("people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/DgsClient.kt index ce70c40d4..ce8ffb697 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedQuery.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedQuery.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/client/PersonProjection.kt index a9ccab13c..7571d4b39 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedQuery.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: PersonProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/client/QueryProjection.kt index 5f03cb2c4..6959b89e0 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/client/QueryProjection.kt @@ -1,15 +1,18 @@ package com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedQuery.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("people", PersonProjection(), _projection) + field("people", PersonProjection(inputValueSerializer), _projection) return this } public fun friends(_projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("friends", PersonProjection(), _projection) + field("friends", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/DgsClient.kt index 4202f53f9..3998f0453 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedTypes.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedTypes.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/client/PersonProjection.kt index f95022065..80dfe0624 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedTypes.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: PersonProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/client/QueryProjection.kt index 58fe18140..aec0334f3 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/client/QueryProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedTypes.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("people", PersonProjection(), _projection) + field("people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/DgsClient.kt index d4bdf4e57..56cac36cd 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassDocs.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassDocs.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/client/MovieProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/client/MovieProjection.kt index f13be26ab..1be5ef5a0 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/client/MovieProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/client/MovieProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassDocs.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class MovieProjection : GraphQLProjection() { +public class MovieProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val title: MovieProjection get() { field("title") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/client/QueryProjection.kt index 1f095908c..45982df2d 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/client/QueryProjection.kt @@ -1,12 +1,16 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassDocs.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassDocs.expected.types.MovieFilter -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun search(movieFilter: MovieFilter, _projection: MovieProjection.() -> MovieProjection): QueryProjection { - field("search", MovieProjection(), _projection, "movieFilter" to movieFilter) + field("search", MovieProjection(inputValueSerializer), _projection, "movieFilter" to + movieFilter) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/DgsClient.kt index d8577e5a9..b4f7417bd 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassFieldDocs.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassFieldDocs.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/client/MovieProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/client/MovieProjection.kt index 4e0b67555..4788342db 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/client/MovieProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/client/MovieProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassFieldDocs.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class MovieProjection : GraphQLProjection() { +public class MovieProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val title: MovieProjection get() { field("title") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/client/QueryProjection.kt index 0568b1af4..bdcb099bc 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/client/QueryProjection.kt @@ -1,12 +1,16 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassFieldDocs.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassFieldDocs.expected.types.MovieFilter -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun search(movieFilter: MovieFilter, _projection: MovieProjection.() -> MovieProjection): QueryProjection { - field("search", MovieProjection(), _projection, "movieFilter" to movieFilter) + field("search", MovieProjection(inputValueSerializer), _projection, "movieFilter" to + movieFilter) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWIthNoFields/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWIthNoFields/expected/DgsClient.kt index 080940266..72cabca6d 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWIthNoFields/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWIthNoFields/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWIthNoFields.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassWIthNoFields.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWIthNoFields/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWIthNoFields/expected/client/PersonProjection.kt index 0732548ee..fb74196e3 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWIthNoFields/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWIthNoFields/expected/client/PersonProjection.kt @@ -1,5 +1,8 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWIthNoFields.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWIthNoFields/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWIthNoFields/expected/client/QueryProjection.kt index 8c211655e..8e7943aa1 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWIthNoFields/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWIthNoFields/expected/client/QueryProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWIthNoFields.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun me(_projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("me", PersonProjection(), _projection) + field("me", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/DgsClient.kt index 55c496a98..c52f28271 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithBooleanField.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassWithBooleanField.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/client/QueryProjection.kt index be5af3f9e..2a5ae0203 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/client/QueryProjection.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithBooleanField.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun test(_projection: RequiredTestTypeProjection.() -> RequiredTestTypeProjection): QueryProjection { - field("test", RequiredTestTypeProjection(), _projection) + field("test", RequiredTestTypeProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/client/RequiredTestTypeProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/client/RequiredTestTypeProjection.kt index 6020d1d55..160bba5c3 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/client/RequiredTestTypeProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/client/RequiredTestTypeProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithBooleanField.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class RequiredTestTypeProjection : GraphQLProjection() { +public class RequiredTestTypeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val isRequired: RequiredTestTypeProjection get() { field("isRequired") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/DgsClient.kt index 22bd67302..18888d910 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithDeclaredScalars.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassWithDeclaredScalars.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/EntityConnectionProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/EntityConnectionProjection.kt index 3e266ae39..742172045 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/EntityConnectionProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/EntityConnectionProjection.kt @@ -1,17 +1,20 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithDeclaredScalars.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class EntityConnectionProjection : GraphQLProjection() { +public class EntityConnectionProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun pageInfo(_projection: PageInfoProjection.() -> PageInfoProjection): EntityConnectionProjection { - field("pageInfo", PageInfoProjection(), _projection) + field("pageInfo", PageInfoProjection(inputValueSerializer), _projection) return this } public fun edges(_projection: EntityEdgeProjection.() -> EntityEdgeProjection): EntityConnectionProjection { - field("edges", EntityEdgeProjection(), _projection) + field("edges", EntityEdgeProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/EntityEdgeProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/EntityEdgeProjection.kt index afbeb21c7..7bddc9b93 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/EntityEdgeProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/EntityEdgeProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithDeclaredScalars.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class EntityEdgeProjection : GraphQLProjection() { +public class EntityEdgeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val cursor: EntityEdgeProjection get() { field("cursor") @@ -10,7 +13,7 @@ public class EntityEdgeProjection : GraphQLProjection() { } public fun node(_projection: EntityProjection.() -> EntityProjection): EntityEdgeProjection { - field("node", EntityProjection(), _projection) + field("node", EntityProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/EntityProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/EntityProjection.kt index 039cb95e6..8ec0ae9dd 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/EntityProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/EntityProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithDeclaredScalars.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class EntityProjection : GraphQLProjection() { +public class EntityProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val long: EntityProjection get() { field("long") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/PageInfoProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/PageInfoProjection.kt index 81bc2a5f3..272a94d30 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/PageInfoProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/PageInfoProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithDeclaredScalars.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PageInfoProjection : GraphQLProjection() { +public class PageInfoProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val startCursor: PageInfoProjection get() { field("startCursor") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/QueryProjection.kt index cd45546d4..d7790b373 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/QueryProjection.kt @@ -1,17 +1,20 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithDeclaredScalars.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun entity(_projection: EntityProjection.() -> EntityProjection): QueryProjection { - field("entity", EntityProjection(), _projection) + field("entity", EntityProjection(inputValueSerializer), _projection) return this } public fun entityConnection(_projection: EntityConnectionProjection.() -> EntityConnectionProjection): QueryProjection { - field("entityConnection", EntityConnectionProjection(), _projection) + field("entityConnection", EntityConnectionProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/DgsClient.kt index d45ad1210..e8f105249 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithDeeplyNestedComplexField.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassWithDeeplyNestedComplexField.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/CarProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/CarProjection.kt index be3f36c41..621c9d4f9 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/CarProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/CarProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithDeeplyNestedComplexField.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class CarProjection : GraphQLProjection() { +public class CarProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val make: CarProjection get() { field("make") @@ -16,7 +19,7 @@ public class CarProjection : GraphQLProjection() { } public fun engine(_projection: EngineProjection.() -> EngineProjection): CarProjection { - field("engine", EngineProjection(), _projection) + field("engine", EngineProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/EngineProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/EngineProjection.kt index 3d24bd5e1..167b06785 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/EngineProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/EngineProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithDeeplyNestedComplexField.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class EngineProjection : GraphQLProjection() { +public class EngineProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val type: EngineProjection get() { field("type") @@ -23,7 +26,7 @@ public class EngineProjection : GraphQLProjection() { public fun performance(_projection: PerformanceProjection.() -> PerformanceProjection): EngineProjection { - field("performance", PerformanceProjection(), _projection) + field("performance", PerformanceProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/PerformanceProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/PerformanceProjection.kt index 53de97a96..2223ab002 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/PerformanceProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/PerformanceProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithDeeplyNestedComplexField.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PerformanceProjection : GraphQLProjection() { +public class PerformanceProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val zeroToSixty: PerformanceProjection get() { field("zeroToSixty") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/QueryProjection.kt index 7acb3b439..4e6c69819 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/QueryProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithDeeplyNestedComplexField.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun cars(_projection: CarProjection.() -> CarProjection): QueryProjection { - field("cars", CarProjection(), _projection) + field("cars", CarProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithExtendedInterface/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithExtendedInterface/expected/DgsClient.kt index 0a451b275..d949b46c2 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithExtendedInterface/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithExtendedInterface/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithExtendedInterface.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassWithExtendedInterface.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithExtendedInterface/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithExtendedInterface/expected/client/PersonProjection.kt index fb39eedf3..134e85f35 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithExtendedInterface/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithExtendedInterface/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithExtendedInterface.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: PersonProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithExtendedInterface/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithExtendedInterface/expected/client/QueryProjection.kt index a69f168d1..f24b32705 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithExtendedInterface/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithExtendedInterface/expected/client/QueryProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithExtendedInterface.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("people", PersonProjection(), _projection) + field("people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/DgsClient.kt index 78d29b4d8..686bcb7ab 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithInterface.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassWithInterface.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/client/EmployeeProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/client/EmployeeProjection.kt index c6a1bd789..9ce80615c 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/client/EmployeeProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/client/EmployeeProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithInterface.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class EmployeeProjection : GraphQLProjection() { +public class EmployeeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: EmployeeProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/client/PersonProjection.kt index acb719f50..2529bf41b 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithInterface.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: PersonProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/client/QueryProjection.kt index 224bab404..06e970caf 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/client/QueryProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithInterface.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("people", PersonProjection(), _projection) + field("people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/DgsClient.kt index 3daa80d05..5cd02ccfd 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithInterfaceInheritance.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassWithInterfaceInheritance.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/client/EmployeeProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/client/EmployeeProjection.kt index b2465b78d..dc67040d8 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/client/EmployeeProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/client/EmployeeProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithInterfaceInheritance.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class EmployeeProjection : GraphQLProjection() { +public class EmployeeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: EmployeeProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/client/PersonProjection.kt index 22bd9d0d5..4f32dcae4 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithInterfaceInheritance.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: PersonProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/client/QueryProjection.kt index dfaa2a460..aa9c44767 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/client/QueryProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithInterfaceInheritance.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("people", PersonProjection(), _projection) + field("people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/client/TalentProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/client/TalentProjection.kt index d908e3dcb..a72938e85 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/client/TalentProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/client/TalentProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithInterfaceInheritance.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class TalentProjection : GraphQLProjection() { +public class TalentProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: TalentProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/DgsClient.kt index 5e0eab427..13636d2b0 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithListProperties.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassWithListProperties.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/client/PersonProjection.kt index 56112e7dd..7b330e8d6 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithListProperties.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val name: PersonProjection get() { field("name") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/client/QueryProjection.kt index 717af733a..27fc58908 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/client/QueryProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithListProperties.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("people", PersonProjection(), _projection) + field("people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/DgsClient.kt index a08871a6f..7b5876263 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithMappedInterfaces.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassWithMappedInterfaces.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/client/EntityProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/client/EntityProjection.kt index 411fc4bc2..f76958e8c 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/client/EntityProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/client/EntityProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithMappedInterfaces.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class EntityProjection : GraphQLProjection() { +public class EntityProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val id: EntityProjection get() { field("id") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/client/NodeProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/client/NodeProjection.kt index 10f457f6a..896b2fcc7 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/client/NodeProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/client/NodeProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithMappedInterfaces.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class NodeProjection : GraphQLProjection() { +public class NodeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val id: NodeProjection get() { field("id") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/client/ProductProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/client/ProductProjection.kt index b919450f5..3b7237588 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/client/ProductProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/client/ProductProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithMappedInterfaces.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class ProductProjection : GraphQLProjection() { +public class ProductProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val id: ProductProjection get() { field("id") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/client/QueryProjection.kt index 7749ffa85..315e070cf 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/client/QueryProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithMappedInterfaces.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun products(_projection: ProductProjection.() -> ProductProjection): QueryProjection { - field("products", ProductProjection(), _projection) + field("products", ProductProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/DgsClient.kt index 4dcdf5bb8..f3fcfac68 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithMappedTypes.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassWithMappedTypes.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/EntityConnectionProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/EntityConnectionProjection.kt index e48ea36d9..167ab5166 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/EntityConnectionProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/EntityConnectionProjection.kt @@ -1,17 +1,20 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithMappedTypes.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class EntityConnectionProjection : GraphQLProjection() { +public class EntityConnectionProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun pageInfo(_projection: PageInfoProjection.() -> PageInfoProjection): EntityConnectionProjection { - field("pageInfo", PageInfoProjection(), _projection) + field("pageInfo", PageInfoProjection(inputValueSerializer), _projection) return this } public fun edges(_projection: EntityEdgeProjection.() -> EntityEdgeProjection): EntityConnectionProjection { - field("edges", EntityEdgeProjection(), _projection) + field("edges", EntityEdgeProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/EntityEdgeProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/EntityEdgeProjection.kt index 897cb9c22..9fd88ab0a 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/EntityEdgeProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/EntityEdgeProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithMappedTypes.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class EntityEdgeProjection : GraphQLProjection() { +public class EntityEdgeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val cursor: EntityEdgeProjection get() { field("cursor") @@ -10,7 +13,7 @@ public class EntityEdgeProjection : GraphQLProjection() { } public fun node(_projection: EntityProjection.() -> EntityProjection): EntityEdgeProjection { - field("node", EntityProjection(), _projection) + field("node", EntityProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/EntityProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/EntityProjection.kt index 70625f94d..19b0dc01e 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/EntityProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/EntityProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithMappedTypes.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class EntityProjection : GraphQLProjection() { +public class EntityProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val long: EntityProjection get() { field("long") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/PageInfoProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/PageInfoProjection.kt index 089001f36..8a41ac8f5 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/PageInfoProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/PageInfoProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithMappedTypes.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PageInfoProjection : GraphQLProjection() { +public class PageInfoProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val startCursor: PageInfoProjection get() { field("startCursor") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/QueryProjection.kt index a83aff410..f7b98244d 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/client/QueryProjection.kt @@ -1,17 +1,20 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithMappedTypes.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun entity(_projection: EntityProjection.() -> EntityProjection): QueryProjection { - field("entity", EntityProjection(), _projection) + field("entity", EntityProjection(inputValueSerializer), _projection) return this } public fun entityConnection(_projection: EntityConnectionProjection.() -> EntityConnectionProjection): QueryProjection { - field("entityConnection", EntityConnectionProjection(), _projection) + field("entityConnection", EntityConnectionProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/DgsClient.kt index facb4fd65..11d0abf8d 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithNonNullableAndInterface.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassWithNonNullableAndInterface.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/client/EmployeeProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/client/EmployeeProjection.kt index b7f57caa9..c67c3d847 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/client/EmployeeProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/client/EmployeeProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithNonNullableAndInterface.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class EmployeeProjection : GraphQLProjection() { +public class EmployeeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: EmployeeProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/client/PersonProjection.kt index 71eb76005..66d88af97 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithNonNullableAndInterface.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: PersonProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/client/QueryProjection.kt index aeae84bab..59a38410d 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/client/QueryProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithNonNullableAndInterface.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("people", PersonProjection(), _projection) + field("people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableComplexType/expected/client/MyTypeProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableComplexType/expected/client/MyTypeProjection.kt index 7bd55c787..e8b7abf07 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableComplexType/expected/client/MyTypeProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableComplexType/expected/client/MyTypeProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithNonNullableComplexType.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class MyTypeProjection : GraphQLProjection() { +public class MyTypeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun other(_projection: OtherTypeProjection.() -> OtherTypeProjection): MyTypeProjection { - field("other", OtherTypeProjection(), _projection) + field("other", OtherTypeProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableComplexType/expected/client/OtherTypeProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableComplexType/expected/client/OtherTypeProjection.kt index 0ae4567bd..ceb5fc99a 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableComplexType/expected/client/OtherTypeProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableComplexType/expected/client/OtherTypeProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithNonNullableComplexType.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class OtherTypeProjection : GraphQLProjection() { +public class OtherTypeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val name: OtherTypeProjection get() { field("name") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/DgsClient.kt index 39bd2401b..b2a8baf51 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithNonNullableListOfNullableValues.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassWithNonNullableListOfNullableValues.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/client/PersonProjection.kt index 58cb124a7..3165511af 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithNonNullableListOfNullableValues.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val name: PersonProjection get() { field("name") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/client/QueryProjection.kt index 80cf787d2..5a92edce7 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/client/QueryProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithNonNullableListOfNullableValues.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("people", PersonProjection(), _projection) + field("people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullablePrimitive/expected/client/MyTypeProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullablePrimitive/expected/client/MyTypeProjection.kt index 7be322dc6..ebb2499ea 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullablePrimitive/expected/client/MyTypeProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullablePrimitive/expected/client/MyTypeProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithNonNullablePrimitive.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class MyTypeProjection : GraphQLProjection() { +public class MyTypeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val count: MyTypeProjection get() { field("count") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullablePrimitiveInList/expected/client/MyTypeProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullablePrimitiveInList/expected/client/MyTypeProjection.kt index 4a905ed79..4e07f4bae 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullablePrimitiveInList/expected/client/MyTypeProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullablePrimitiveInList/expected/client/MyTypeProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithNonNullablePrimitiveInList.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class MyTypeProjection : GraphQLProjection() { +public class MyTypeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val count: MyTypeProjection get() { field("count") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/DgsClient.kt index 6566a9dc5..72d692cf9 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithNonNullableProperties.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassWithNonNullableProperties.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/client/PersonProjection.kt index a226b74e8..aded34ec7 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithNonNullableProperties.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val name: PersonProjection get() { field("name") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/client/QueryProjection.kt index b1ddf513c..6c66b2526 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/client/QueryProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithNonNullableProperties.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("people", PersonProjection(), _projection) + field("people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNullablePrimitive/expected/client/MyTypeProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNullablePrimitive/expected/client/MyTypeProjection.kt index f7b27d52c..b8c2625fa 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNullablePrimitive/expected/client/MyTypeProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNullablePrimitive/expected/client/MyTypeProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithNullablePrimitive.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class MyTypeProjection : GraphQLProjection() { +public class MyTypeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val count: MyTypeProjection get() { field("count") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/DgsClient.kt index 137dd6747..49f11c732 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithRecursiveField.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassWithRecursiveField.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/client/PersonProjection.kt index 83796a3ce..daa6b0f04 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithRecursiveField.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: PersonProjection get() { field("firstname") @@ -16,7 +19,7 @@ public class PersonProjection : GraphQLProjection() { } public fun friends(_projection: PersonProjection.() -> PersonProjection): PersonProjection { - field("friends", PersonProjection(), _projection) + field("friends", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/client/QueryProjection.kt index 99daaeed3..01a74e4f7 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/client/QueryProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithRecursiveField.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("people", PersonProjection(), _projection) + field("people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithReservedWord/expected/client/SampleTypeProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithReservedWord/expected/client/SampleTypeProjection.kt index f92365a97..0bef9b0cd 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithReservedWord/expected/client/SampleTypeProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithReservedWord/expected/client/SampleTypeProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithReservedWord.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class SampleTypeProjection : GraphQLProjection() { +public class SampleTypeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val `return`: SampleTypeProjection get() { field("return") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/DgsClient.kt index 4e53a7c16..da44d909d 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithStringProperties.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.dataClassWithStringProperties.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/client/PersonProjection.kt index dfad65469..302af44e7 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithStringProperties.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: PersonProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/client/QueryProjection.kt index 42ab08131..e5ddabb05 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/client/QueryProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithStringProperties.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("people", PersonProjection(), _projection) + field("people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enum/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enum/expected/DgsClient.kt index 7b95db285..eb2b666d3 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enum/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enum/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.`enum`.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.`enum`.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enum/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enum/expected/client/QueryProjection.kt index 9163fd1a1..c8bd9caa8 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enum/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enum/expected/client/QueryProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.`enum`.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val types: QueryProjection get() { field("types") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enumWithExtendedType/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enumWithExtendedType/expected/DgsClient.kt index 2070401f5..eb943aa14 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enumWithExtendedType/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enumWithExtendedType/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.enumWithExtendedType.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.enumWithExtendedType.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enumWithExtendedType/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enumWithExtendedType/expected/client/QueryProjection.kt index e76e95d75..6e53aa528 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enumWithExtendedType/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enumWithExtendedType/expected/client/QueryProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.enumWithExtendedType.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val types: QueryProjection get() { field("types") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/expected/DgsClient.kt index 12dabcd39..8c6ab293c 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.input.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.input.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/expected/client/QueryProjection.kt index c1022e7f5..839f29af5 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/expected/client/QueryProjection.kt @@ -1,9 +1,12 @@ package com.netflix.graphql.dgs.codegen.cases.input.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.input.expected.types.MovieFilter -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun movies(filter: MovieFilter? = default("filter")): QueryProjection { field("movies", "filter" to filter) diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/test/QueryTest.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/test/QueryTest.kt index 8281b2648..9788b2839 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/test/QueryTest.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/test/QueryTest.kt @@ -19,7 +19,6 @@ package com.netflix.graphql.dgs.codegen.cases.input.test import com.netflix.graphql.dgs.client.codegen.InputValueSerializer -import com.netflix.graphql.dgs.codegen.InputValueSerializerProvider import com.netflix.graphql.dgs.codegen.cases.input.expected.DgsClient import com.netflix.graphql.dgs.codegen.cases.input.expected.types.MovieFilter import graphql.language.StringValue @@ -134,50 +133,22 @@ class QueryTest { @Test fun testQueryWithFilterAndCustomCoercing() { - try { - InputValueSerializerProvider.serializer = InputValueSerializer( - mapOf(MovieFilter::class.java to movieCoercing) - ) - val query = DgsClient.buildQuery { - movies(filter = MovieFilter(genre = "horror")) - } - - Assertions.assertEquals( - """{ - | __typename - | movies(filter: "horror") - |} - | - """.trimMargin(), - query - ) - } finally { - InputValueSerializerProvider.reset() - } - } - @Test - fun testResetInputValueSerializerProvider() { - try { - InputValueSerializerProvider.serializer = InputValueSerializer( - mapOf(MovieFilter::class.java to movieCoercing) - ) - InputValueSerializerProvider.reset() - - val query = DgsClient.buildQuery { - movies(filter = MovieFilter(genre = "horror")) - } - Assertions.assertEquals( - """{ - | __typename - | movies(filter: {genre : "horror"}) - |} - | - """.trimMargin(), - query - ) - } finally { - InputValueSerializerProvider.reset() + val serializer = InputValueSerializer( + mapOf(MovieFilter::class.java to movieCoercing) + ) + val query = DgsClient.buildQuery(serializer) { + movies(filter = MovieFilter(genre = "horror")) } + + Assertions.assertEquals( + """{ + | __typename + | movies(filter: "horror") + |} + | + """.trimMargin(), + query + ) } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/inputWithExtendedType/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/inputWithExtendedType/expected/DgsClient.kt index 44176e0a8..19f56f2f0 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/inputWithExtendedType/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/inputWithExtendedType/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.inputWithExtendedType.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.inputWithExtendedType.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/inputWithExtendedType/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/inputWithExtendedType/expected/client/QueryProjection.kt index 12136e4fe..2c8098346 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/inputWithExtendedType/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/inputWithExtendedType/expected/client/QueryProjection.kt @@ -1,9 +1,12 @@ package com.netflix.graphql.dgs.codegen.cases.inputWithExtendedType.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.inputWithExtendedType.expected.types.MovieFilter -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun movies(filter: MovieFilter? = default("filter")): QueryProjection { field("movies", "filter" to filter) diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/client/BirdProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/client/BirdProjection.kt index 1226e25aa..d7903679f 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/client/BirdProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/client/BirdProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceClassWithInterfaceFields.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class BirdProjection : GraphQLProjection() { +public class BirdProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val id: BirdProjection get() { field("id") @@ -22,17 +25,17 @@ public class BirdProjection : GraphQLProjection() { } public fun mother(_projection: BirdProjection.() -> BirdProjection): BirdProjection { - field("mother", BirdProjection(), _projection) + field("mother", BirdProjection(inputValueSerializer), _projection) return this } public fun father(_projection: BirdProjection.() -> BirdProjection): BirdProjection { - field("father", BirdProjection(), _projection) + field("father", BirdProjection(inputValueSerializer), _projection) return this } public fun parents(_projection: BirdProjection.() -> BirdProjection): BirdProjection { - field("parents", BirdProjection(), _projection) + field("parents", BirdProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/client/DogProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/client/DogProjection.kt index 37fdca7f7..4719cc9d7 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/client/DogProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/client/DogProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceClassWithInterfaceFields.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class DogProjection : GraphQLProjection() { +public class DogProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val id: DogProjection get() { field("id") @@ -22,17 +25,17 @@ public class DogProjection : GraphQLProjection() { } public fun mother(_projection: DogProjection.() -> DogProjection): DogProjection { - field("mother", DogProjection(), _projection) + field("mother", DogProjection(inputValueSerializer), _projection) return this } public fun father(_projection: DogProjection.() -> DogProjection): DogProjection { - field("father", DogProjection(), _projection) + field("father", DogProjection(inputValueSerializer), _projection) return this } public fun parents(_projection: DogProjection.() -> DogProjection): DogProjection { - field("parents", DogProjection(), _projection) + field("parents", DogProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/client/PetProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/client/PetProjection.kt index 3ca1290f9..476271195 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/client/PetProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/client/PetProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceClassWithInterfaceFields.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PetProjection : GraphQLProjection() { +public class PetProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val id: PetProjection get() { field("id") @@ -22,17 +25,17 @@ public class PetProjection : GraphQLProjection() { } public fun mother(_projection: PetProjection.() -> PetProjection): PetProjection { - field("mother", PetProjection(), _projection) + field("mother", PetProjection(inputValueSerializer), _projection) return this } public fun father(_projection: PetProjection.() -> PetProjection): PetProjection { - field("father", PetProjection(), _projection) + field("father", PetProjection(inputValueSerializer), _projection) return this } public fun parents(_projection: PetProjection.() -> PetProjection): PetProjection { - field("parents", PetProjection(), _projection) + field("parents", PetProjection(inputValueSerializer), _projection) return this } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/client/DietProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/client/DietProjection.kt index d967b9881..0bf773e59 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/client/DietProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/client/DietProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceClassWithInterfaceFieldsOfDifferentType.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class DietProjection : GraphQLProjection() { +public class DietProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val calories: DietProjection get() { field("calories") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/client/DogProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/client/DogProjection.kt index 69b67adda..2ef26199b 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/client/DogProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/client/DogProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceClassWithInterfaceFieldsOfDifferentType.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class DogProjection : GraphQLProjection() { +public class DogProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val name: DogProjection get() { field("name") @@ -10,7 +13,7 @@ public class DogProjection : GraphQLProjection() { } public fun diet(_projection: VegetarianProjection.() -> VegetarianProjection): DogProjection { - field("diet", VegetarianProjection(), _projection) + field("diet", VegetarianProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/client/PetProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/client/PetProjection.kt index ef5e49202..4b13eafa1 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/client/PetProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/client/PetProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceClassWithInterfaceFieldsOfDifferentType.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PetProjection : GraphQLProjection() { +public class PetProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val name: PetProjection get() { field("name") @@ -10,7 +13,7 @@ public class PetProjection : GraphQLProjection() { } public fun diet(_projection: DietProjection.() -> DietProjection): PetProjection { - field("diet", DietProjection(), _projection) + field("diet", DietProjection(inputValueSerializer), _projection) return this } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/client/VegetarianProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/client/VegetarianProjection.kt index 657b05895..40d997809 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/client/VegetarianProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/client/VegetarianProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceClassWithInterfaceFieldsOfDifferentType.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class VegetarianProjection : GraphQLProjection() { +public class VegetarianProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val calories: VegetarianProjection get() { field("calories") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/DgsClient.kt index 10a4a2f38..980e4bba8 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceClassWithNonNullableFields.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.interfaceClassWithNonNullableFields.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/client/EmployeeProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/client/EmployeeProjection.kt index 1076e0504..17050a084 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/client/EmployeeProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/client/EmployeeProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceClassWithNonNullableFields.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class EmployeeProjection : GraphQLProjection() { +public class EmployeeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: EmployeeProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/client/PersonProjection.kt index ef7b3cc25..b918c94df 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceClassWithNonNullableFields.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: PersonProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/client/QueryProjection.kt index 0bc6afdf1..25f98faa8 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/client/QueryProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceClassWithNonNullableFields.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("people", PersonProjection(), _projection) + field("people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceDocs/expected/client/TitledProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceDocs/expected/client/TitledProjection.kt index 9766b6beb..dffc6bc79 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceDocs/expected/client/TitledProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceDocs/expected/client/TitledProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceDocs.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class TitledProjection : GraphQLProjection() { +public class TitledProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val title: TitledProjection get() { field("title") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceFieldsDocs/expected/client/TitledProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceFieldsDocs/expected/client/TitledProjection.kt index b61c94cc2..c8012532b 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceFieldsDocs/expected/client/TitledProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceFieldsDocs/expected/client/TitledProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceFieldsDocs.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class TitledProjection : GraphQLProjection() { +public class TitledProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val title: TitledProjection get() { field("title") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/DgsClient.kt index d2f43db68..a6a4b3118 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceWithInterfaceInheritance.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.interfaceWithInterfaceInheritance.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/client/FruitProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/client/FruitProjection.kt index 2a87b5b0c..81f67918a 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/client/FruitProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/client/FruitProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceWithInterfaceInheritance.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class FruitProjection : GraphQLProjection() { +public class FruitProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun seeds(_projection: SeedProjection.() -> SeedProjection): FruitProjection { - field("seeds", SeedProjection(), _projection) + field("seeds", SeedProjection(inputValueSerializer), _projection) return this } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/client/QueryProjection.kt index 3abf122d1..8c8900e6e 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/client/QueryProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceWithInterfaceInheritance.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun fruits(_projection: FruitProjection.() -> FruitProjection): QueryProjection { - field("fruits", FruitProjection(), _projection) + field("fruits", FruitProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/client/SeedProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/client/SeedProjection.kt index 8a423643b..b037ff455 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/client/SeedProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/client/SeedProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceWithInterfaceInheritance.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class SeedProjection : GraphQLProjection() { +public class SeedProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val name: SeedProjection get() { field("name") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/client/StoneFruitProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/client/StoneFruitProjection.kt index f73f5f500..8164992af 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/client/StoneFruitProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/client/StoneFruitProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.interfaceWithInterfaceInheritance.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class StoneFruitProjection : GraphQLProjection() { +public class StoneFruitProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val fuzzy: StoneFruitProjection get() { field("fuzzy") @@ -10,7 +13,7 @@ public class StoneFruitProjection : GraphQLProjection() { } public fun seeds(_projection: SeedProjection.() -> SeedProjection): StoneFruitProjection { - field("seeds", SeedProjection(), _projection) + field("seeds", SeedProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithEnum/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithEnum/expected/DgsClient.kt index 36bc94ef4..b338d636f 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithEnum/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithEnum/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithEnum.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.projectionWithEnum.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithEnum/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithEnum/expected/client/QueryProjection.kt index ec23c0faa..1d8f7606e 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithEnum/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithEnum/expected/client/QueryProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithEnum.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val e: QueryProjection get() { field("e") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithNestedInputs/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithNestedInputs/expected/DgsClient.kt index 28e9e2cf1..0b36a5b73 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithNestedInputs/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithNestedInputs/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithNestedInputs.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.projectionWithNestedInputs.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithNestedInputs/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithNestedInputs/expected/client/QueryProjection.kt index 2822d4df0..5eb527e2a 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithNestedInputs/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithNestedInputs/expected/client/QueryProjection.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithNestedInputs.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.projectionWithNestedInputs.expected.types.I1 import com.netflix.graphql.dgs.codegen.cases.projectionWithNestedInputs.expected.types.I2 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun q1(arg1: String? = default("arg1"), arg2: I2? = default("arg2")): QueryProjection { field("q1", "arg1" to arg1 , "arg2" to arg2) diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitiveAndArgs/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitiveAndArgs/expected/DgsClient.kt index 5f44888d6..8b26ff585 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitiveAndArgs/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitiveAndArgs/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithPrimitiveAndArgs.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.projectionWithPrimitiveAndArgs.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitiveAndArgs/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitiveAndArgs/expected/client/QueryProjection.kt index 719963754..d9e4a2ef8 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitiveAndArgs/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitiveAndArgs/expected/client/QueryProjection.kt @@ -1,10 +1,13 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithPrimitiveAndArgs.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.projectionWithPrimitiveAndArgs.expected.types.I import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun string( a1: String? = default("a1"), a2: String, diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitives/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitives/expected/DgsClient.kt index 084871bbd..ed57667de 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitives/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitives/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithPrimitives.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.projectionWithPrimitives.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitives/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitives/expected/client/QueryProjection.kt index 7abd88b88..858b26451 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitives/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitives/expected/client/QueryProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithPrimitives.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val string: QueryProjection get() { field("string") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/DgsClient.kt index a28d05258..876761a7a 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithType.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.projectionWithType.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/client/EmployeeProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/client/EmployeeProjection.kt index 7f3ca171f..ac1381d4e 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/client/EmployeeProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/client/EmployeeProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithType.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class EmployeeProjection : GraphQLProjection() { +public class EmployeeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: EmployeeProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/client/PersonProjection.kt index c173fa278..f2434dfd4 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithType.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: PersonProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/client/QueryProjection.kt index 50265e47e..6bec1be5a 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/client/QueryProjection.kt @@ -1,15 +1,18 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithType.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun person(_projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("person", PersonProjection(), _projection) + field("person", PersonProjection(inputValueSerializer), _projection) return this } public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection { - field("people", PersonProjection(), _projection) + field("people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/DgsClient.kt index e9c1252eb..3358ba35b 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithTypeAndArgs.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.projectionWithTypeAndArgs.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/client/EmployeeProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/client/EmployeeProjection.kt index cf3a4e821..29312d55c 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/client/EmployeeProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/client/EmployeeProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithTypeAndArgs.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class EmployeeProjection : GraphQLProjection() { +public class EmployeeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: EmployeeProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/client/PersonProjection.kt index c1f9c82e4..37e02e25c 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithTypeAndArgs.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: PersonProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/client/QueryProjection.kt index d4f012890..7c8293453 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/client/QueryProjection.kt @@ -1,17 +1,21 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithTypeAndArgs.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.projectionWithTypeAndArgs.expected.types.I import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun person( a1: String? = default("a1"), a2: String, a3: I? = default("a3"), _projection: PersonProjection.() -> PersonProjection, ): QueryProjection { - field("person", PersonProjection(), _projection, "a1" to a1 , "a2" to a2 , "a3" to a3) + field("person", PersonProjection(inputValueSerializer), _projection, "a1" to a1 , "a2" to a2 , + "a3" to a3) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/DgsClient.kt index caef12149..64f303987 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithUnion.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.projectionWithUnion.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/client/EmployeeProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/client/EmployeeProjection.kt index 0dc109213..e73bda737 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/client/EmployeeProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/client/EmployeeProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithUnion.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class EmployeeProjection : GraphQLProjection() { +public class EmployeeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: EmployeeProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/client/PersonProjection.kt index 03c117847..fb73afa29 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithUnion.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: PersonProjection get() { field("firstname") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/client/QueryProjection.kt index 8feedac01..82720c43a 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/client/QueryProjection.kt @@ -1,15 +1,18 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithUnion.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun u(_projection: UProjection.() -> UProjection): QueryProjection { - field("u", UProjection(), _projection) + field("u", UProjection(inputValueSerializer), _projection) return this } public fun us(_projection: UProjection.() -> UProjection): QueryProjection { - field("us", UProjection(), _projection) + field("us", UProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/client/UProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/client/UProjection.kt index e8b7097ba..4ec5862ec 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/client/UProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/client/UProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.projectionWithUnion.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class UProjection : GraphQLProjection() { +public class UProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun onEmployee(_projection: EmployeeProjection.() -> EmployeeProjection): UProjection { fragment("Employee", EmployeeProjection(), _projection) return this diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnFields/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnFields/expected/client/PersonProjection.kt index c58ea5e24..b6f2e7b5e 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnFields/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnFields/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.skipCodegenOnFields.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val name: PersonProjection get() { field("name") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnInterfaceFields/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnInterfaceFields/expected/client/PersonProjection.kt index da21f6892..3ce7dce05 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnInterfaceFields/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnInterfaceFields/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.skipCodegenOnInterfaceFields.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val name: PersonProjection get() { field("name") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnTypes/expected/client/PersonProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnTypes/expected/client/PersonProjection.kt index caa6b08d4..ba4b70d8b 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnTypes/expected/client/PersonProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnTypes/expected/client/PersonProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.skipCodegenOnTypes.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val name: PersonProjection get() { field("name") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/DgsClient.kt index f1d8a01c3..352f6a4b0 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.union.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.union.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/client/ActorProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/client/ActorProjection.kt index 9469a2a7d..b8e6d3599 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/client/ActorProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/client/ActorProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.union.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class ActorProjection : GraphQLProjection() { +public class ActorProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val name: ActorProjection get() { field("name") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/client/MovieProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/client/MovieProjection.kt index b8a209fe9..c4cecfc7f 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/client/MovieProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/client/MovieProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.union.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class MovieProjection : GraphQLProjection() { +public class MovieProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val title: MovieProjection get() { field("title") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/client/QueryProjection.kt index 3ccd516d8..631aedad1 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/client/QueryProjection.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.union.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun search(_projection: SearchResultProjection.() -> SearchResultProjection): QueryProjection { - field("search", SearchResultProjection(), _projection) + field("search", SearchResultProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/client/SearchResultProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/client/SearchResultProjection.kt index eff0789fe..151529c5b 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/client/SearchResultProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/client/SearchResultProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.union.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class SearchResultProjection : GraphQLProjection() { +public class SearchResultProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun onMovie(_projection: MovieProjection.() -> MovieProjection): SearchResultProjection { fragment("Movie", MovieProjection(), _projection) return this diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/DgsClient.kt index d7d243c10..3327495e0 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.unionTypesWithoutInterfaceCanDeserialize.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.unionTypesWithoutInterfaceCanDeserialize.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/DroidProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/DroidProjection.kt index 5786c726c..5478ffaa8 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/DroidProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/DroidProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.unionTypesWithoutInterfaceCanDeserialize.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class DroidProjection : GraphQLProjection() { +public class DroidProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val id: DroidProjection get() { field("id") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/HumanProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/HumanProjection.kt index 528c42875..0c2d5e7c3 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/HumanProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/HumanProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.unionTypesWithoutInterfaceCanDeserialize.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class HumanProjection : GraphQLProjection() { +public class HumanProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val id: HumanProjection get() { field("id") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/QueryProjection.kt index 5700b7627..52bed646d 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/QueryProjection.kt @@ -1,12 +1,15 @@ package com.netflix.graphql.dgs.codegen.cases.unionTypesWithoutInterfaceCanDeserialize.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun search(text: String, _projection: SearchResultPageProjection.() -> SearchResultPageProjection): QueryProjection { - field("search", SearchResultPageProjection(), _projection, "text" to text) + field("search", SearchResultPageProjection(inputValueSerializer), _projection, "text" to text) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/SearchResultPageProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/SearchResultPageProjection.kt index 624b1e6af..88a7967c1 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/SearchResultPageProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/SearchResultPageProjection.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.unionTypesWithoutInterfaceCanDeserialize.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class SearchResultPageProjection : GraphQLProjection() { +public class SearchResultPageProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun items(_projection: SearchResultProjection.() -> SearchResultProjection): SearchResultPageProjection { - field("items", SearchResultProjection(), _projection) + field("items", SearchResultProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/SearchResultProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/SearchResultProjection.kt index 20eb7361f..a861c8f5c 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/SearchResultProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/client/SearchResultProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.unionTypesWithoutInterfaceCanDeserialize.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class SearchResultProjection : GraphQLProjection() { +public class SearchResultProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun onHuman(_projection: HumanProjection.() -> HumanProjection): SearchResultProjection { fragment("Human", HumanProjection(), _projection) return this diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/DgsClient.kt index e56a6592f..2cf6592dc 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/DgsClient.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/DgsClient.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.unionWithExtendedType.expected +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.cases.unionWithExtendedType.expected.client.QueryProjection import graphql.language.OperationDefinition import kotlin.String public object DgsClient { - public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = - GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) + public fun buildQuery(inputValueSerializer: InputValueSerializerInterface? = null, + _projection: QueryProjection.() -> QueryProjection): String = + GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, + QueryProjection(inputValueSerializer), _projection) } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/ActorProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/ActorProjection.kt index 3c1899cfd..5ecacaf93 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/ActorProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/ActorProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.unionWithExtendedType.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class ActorProjection : GraphQLProjection() { +public class ActorProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val name: ActorProjection get() { field("name") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/MovieProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/MovieProjection.kt index 9056dfb4e..f7c698880 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/MovieProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/MovieProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.unionWithExtendedType.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class MovieProjection : GraphQLProjection() { +public class MovieProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val title: MovieProjection get() { field("title") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/QueryProjection.kt index b26921e01..a5b1dc557 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/QueryProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/QueryProjection.kt @@ -1,11 +1,14 @@ package com.netflix.graphql.dgs.codegen.cases.unionWithExtendedType.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun search(_projection: SearchResultProjection.() -> SearchResultProjection): QueryProjection { - field("search", SearchResultProjection(), _projection) + field("search", SearchResultProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/RatingProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/RatingProjection.kt index 69fbc6038..c1d73c175 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/RatingProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/RatingProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.unionWithExtendedType.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class RatingProjection : GraphQLProjection() { +public class RatingProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val stars: RatingProjection get() { field("stars") diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/SearchResultProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/SearchResultProjection.kt index 844891561..eba2a85b7 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/SearchResultProjection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/client/SearchResultProjection.kt @@ -1,8 +1,11 @@ package com.netflix.graphql.dgs.codegen.cases.unionWithExtendedType.expected.client +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.GraphQLProjection -public class SearchResultProjection : GraphQLProjection() { +public class SearchResultProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun onMovie(_projection: MovieProjection.() -> MovieProjection): SearchResultProjection { fragment("Movie", MovieProjection(), _projection) return this diff --git a/graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin2/GenerateKotlin2ClientTypes.kt b/graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin2/GenerateKotlin2ClientTypes.kt index 758006aa8..a39393bd9 100644 --- a/graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin2/GenerateKotlin2ClientTypes.kt +++ b/graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin2/GenerateKotlin2ClientTypes.kt @@ -18,6 +18,7 @@ package com.netflix.graphql.dgs.codegen.generators.kotlin2 +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface import com.netflix.graphql.dgs.codegen.CodeGenConfig import com.netflix.graphql.dgs.codegen.GraphQLProjection import com.netflix.graphql.dgs.codegen.filterSkipped @@ -54,6 +55,11 @@ fun generateKotlin2ClientTypes( val typeLookup = Kotlin2TypeLookup(config, document) + val ivsParameter = ParameterSpec + .builder("inputValueSerializer", InputValueSerializerInterface::class.asTypeName().copy(nullable = true)) + .defaultValue("null") + .build() + // create a projection class for every interface & data type val dataProjections = document.getDefinitionsOfType(ObjectTypeDefinition::class.java) .plus(document.getDefinitionsOfType(InterfaceTypeDefinition::class.java)) @@ -119,7 +125,7 @@ fun generateKotlin2ClientTypes( .addParameter(projection) .returns(typeName) .addStatement( - """field(%S, %T(), _projection%L)""", + """field(%S, %T(inputValueSerializer), _projection%L)""", field.name, projectionType, field.inputValueDefinitions.joinToString(" ") { """, "${it.name}" to ${it.name}""" } @@ -137,7 +143,9 @@ fun generateKotlin2ClientTypes( // create the projection class val typeSpec = TypeSpec.classBuilder(typeName) .addOptionalGeneratedAnnotation(config) + .primaryConstructor(FunSpec.constructorBuilder().addParameter(ivsParameter).build()) .superclass(GraphQLProjection::class) + .addSuperclassConstructorParameter("inputValueSerializer") // we can't ask for `__typename` on a `Subscription` object .apply { if (typeDefinition.name == "Subscription") { @@ -170,7 +178,9 @@ fun generateKotlin2ClientTypes( val typeSpec = TypeSpec.classBuilder(typeName) .addOptionalGeneratedAnnotation(config) + .primaryConstructor(FunSpec.constructorBuilder().addParameter(ivsParameter).build()) .superclass(GraphQLProjection::class) + .addSuperclassConstructorParameter("inputValueSerializer") .addFunctions( implementations.map { subclass -> onSubclassProjection(config.packageNameClient, typeName, (subclass as NamedNode<*>).name) @@ -193,10 +203,11 @@ fun generateKotlin2ClientTypes( val (projectionType, projection) = projectionType(config.packageNameClient, type) FunSpec.builder("build$type") + .addParameter(ivsParameter) .addParameter(projection) .returns(String::class) .addStatement( - """return %T.asQuery(%T.%L, %T(), _projection)""", + """return %T.asQuery(%T.%L, %T(inputValueSerializer), _projection)""", GraphQLProjection::class.asTypeName(), op::class.asTypeName(), op.name, diff --git a/graphql-dgs-codegen-shared-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/Kotlin2Core.kt b/graphql-dgs-codegen-shared-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/Kotlin2Core.kt index 1cc5359cf..b190f6ec4 100644 --- a/graphql-dgs-codegen-shared-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/Kotlin2Core.kt +++ b/graphql-dgs-codegen-shared-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/Kotlin2Core.kt @@ -51,26 +51,16 @@ object DefaultTracker { } } -object InputValueSerializerProvider { - private val default: ThreadLocal = ThreadLocal.withInitial { InputValueSerializer() } - - var serializer - get(): InputValueSerializerInterface = default.get() - set(value) = default.set(value) - - fun reset() { - serializer = InputValueSerializer() - } -} - @QueryProjectionMarker abstract class GraphQLProjection( + protected val inputValueSerializer: InputValueSerializerInterface? = null, defaultFields: Set = setOf("__typename"), - private val inputValueSerializer: InputValueSerializerInterface = InputValueSerializerProvider.serializer ) { companion object { + val defaultInputValueSerializer = InputValueSerializer() + @JvmStatic protected fun default0(arg: String): T? { DefaultTracker.add(this::class.qualifiedName!!, arg) @@ -119,7 +109,7 @@ abstract class GraphQLProjection( .map { (arg, value) -> Argument.newArgument() .name(arg) - .value(inputValueSerializer.toValue(value)) + .value((inputValueSerializer ?: defaultInputValueSerializer).toValue(value)) .build() } } From 450d1aca145a034396a1f04cef0528cab8596d40 Mon Sep 17 00:00:00 2001 From: Matt Bossenbroek Date: Fri, 19 Apr 2024 15:27:49 -0700 Subject: [PATCH 3/3] Fix lint issue --- .../main/kotlin/com/netflix/graphql/dgs/codegen/Kotlin2Core.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphql-dgs-codegen-shared-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/Kotlin2Core.kt b/graphql-dgs-codegen-shared-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/Kotlin2Core.kt index b190f6ec4..ac6398db7 100644 --- a/graphql-dgs-codegen-shared-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/Kotlin2Core.kt +++ b/graphql-dgs-codegen-shared-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/Kotlin2Core.kt @@ -54,7 +54,7 @@ object DefaultTracker { @QueryProjectionMarker abstract class GraphQLProjection( protected val inputValueSerializer: InputValueSerializerInterface? = null, - defaultFields: Set = setOf("__typename"), + defaultFields: Set = setOf("__typename") ) { companion object {