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 701c071aa..1752eceb9 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,16 +1,19 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people( _alias: String? = null, filter: PersonFilter? = default("filter"), _projection: PersonProjection.() -> PersonProjection, ): QueryProjection { - field(_alias, "people", PersonProjection(), _projection, "filter" to filter) + field(_alias, "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/constantsForInputTypes/expected/types/Person.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/types/Person.kt index b8dbe24b8..ccdb60b72 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/types/Person.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/types/Person.kt @@ -15,17 +15,17 @@ public class Person( firstname: () -> String? = firstnameDefault, lastname: () -> String? = lastnameDefault, ) { - private val _firstname: () -> String? = firstname + private val __firstname: () -> String? = firstname - private val _lastname: () -> String? = lastname + private val __lastname: () -> String? = lastname @get:JvmName("getFirstname") public val firstname: String? - get() = _firstname.invoke() + get() = __firstname.invoke() @get:JvmName("getLastname") public val lastname: String? - get() = _lastname.invoke() + get() = __lastname.invoke() public companion object { private val firstnameDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/types/Query.kt index b45d9187c..a917ea098 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( people: () -> List? = peopleDefault, ) { - private val _people: () -> List? = people + private val __people: () -> List? = people @get:JvmName("getPeople") public val people: List? - get() = _people.invoke() + get() = __people.invoke() public companion object { private val peopleDefault: () -> List? = 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 6fe4cf51b..729b00234 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,16 +1,19 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people( _alias: String? = null, filter: PersonFilter? = default("filter"), _projection: PersonProjection.() -> PersonProjection, ): QueryProjection { - field(_alias, "people", PersonProjection(), _projection, "filter" to filter) + field(_alias, "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/types/Person.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/types/Person.kt index f3f451d04..8a9bec5d3 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/types/Person.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/types/Person.kt @@ -15,17 +15,17 @@ public class Person( firstname: () -> String? = firstnameDefault, lastname: () -> String? = lastnameDefault, ) { - private val _firstname: () -> String? = firstname + private val __firstname: () -> String? = firstname - private val _lastname: () -> String? = lastname + private val __lastname: () -> String? = lastname @get:JvmName("getFirstname") public val firstname: String? - get() = _firstname.invoke() + get() = __firstname.invoke() @get:JvmName("getLastname") public val lastname: String? - get() = _lastname.invoke() + get() = __lastname.invoke() public companion object { private val firstnameDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/types/Query.kt index db774346d..cc8e669f4 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( people: () -> List? = peopleDefault, ) { - private val _people: () -> List? = people + private val __people: () -> List? = people @get:JvmName("getPeople") public val people: List? - get() = _people.invoke() + get() = __people.invoke() public companion object { private val peopleDefault: () -> List? = 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 12afdff26..326b24d03 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field(_alias, "people", PersonProjection(), _projection) + field(_alias, "people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInterface/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInterface/expected/types/Query.kt index a6f85dbe2..598621086 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInterface/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInterface/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( people: () -> List? = peopleDefault, ) { - private val _people: () -> List? = people + private val __people: () -> List? = people @get:JvmName("getPeople") public val people: List? - get() = _people.invoke() + get() = __people.invoke() public companion object { private val peopleDefault: () -> List? = 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 c7c4b07ca..222b76194 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,18 +1,21 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field(_alias, "people", PersonProjection(), _projection) + field(_alias, "people", PersonProjection(inputValueSerializer), _projection) return this } public fun friends(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field(_alias, "friends", PersonProjection(), _projection) + field(_alias, "friends", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/types/Person.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/types/Person.kt index 07631731b..bb33c9ddc 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/types/Person.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/types/Person.kt @@ -15,17 +15,17 @@ public class Person( firstname: () -> String? = firstnameDefault, lastname: () -> String? = lastnameDefault, ) { - private val _firstname: () -> String? = firstname + private val __firstname: () -> String? = firstname - private val _lastname: () -> String? = lastname + private val __lastname: () -> String? = lastname @get:JvmName("getFirstname") public val firstname: String? - get() = _firstname.invoke() + get() = __firstname.invoke() @get:JvmName("getLastname") public val lastname: String? - get() = _lastname.invoke() + get() = __lastname.invoke() public companion object { private val firstnameDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/types/Query.kt index 437b8d4da..34f6a5c23 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/types/Query.kt @@ -15,17 +15,17 @@ public class Query( people: () -> List? = peopleDefault, friends: () -> List? = friendsDefault, ) { - private val _people: () -> List? = people + private val __people: () -> List? = people - private val _friends: () -> List? = friends + private val __friends: () -> List? = friends @get:JvmName("getPeople") public val people: List? - get() = _people.invoke() + get() = __people.invoke() @get:JvmName("getFriends") public val friends: List? - get() = _friends.invoke() + get() = __friends.invoke() public companion object { private val peopleDefault: () -> List? = 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 8959f039f..9e9e79f41 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field(_alias, "people", PersonProjection(), _projection) + field(_alias, "people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/types/Person.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/types/Person.kt index df6395f5e..8f52f8410 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/types/Person.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/types/Person.kt @@ -16,23 +16,23 @@ public class Person( lastname: () -> String? = lastnameDefault, email: () -> String? = emailDefault, ) { - private val _firstname: () -> String? = firstname + private val __firstname: () -> String? = firstname - private val _lastname: () -> String? = lastname + private val __lastname: () -> String? = lastname - private val _email: () -> String? = email + private val __email: () -> String? = email @get:JvmName("getFirstname") public val firstname: String? - get() = _firstname.invoke() + get() = __firstname.invoke() @get:JvmName("getLastname") public val lastname: String? - get() = _lastname.invoke() + get() = __lastname.invoke() @get:JvmName("getEmail") public val email: String? - get() = _email.invoke() + get() = __email.invoke() public companion object { private val firstnameDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/types/Query.kt index 55fd914e7..1c2ec96b9 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( people: () -> List? = peopleDefault, ) { - private val _people: () -> List? = people + private val __people: () -> List? = people @get:JvmName("getPeople") public val people: List? - get() = _people.invoke() + get() = __people.invoke() public companion object { private val peopleDefault: () -> List? = 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 b07446737..8a8c29993 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,16 +1,20 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun search( _alias: String? = null, movieFilter: MovieFilter, _projection: MovieProjection.() -> MovieProjection, ): QueryProjection { - field(_alias, "search", MovieProjection(), _projection, "movieFilter" to movieFilter) + field(_alias, "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/dataClassDocs/expected/types/Movie.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/types/Movie.kt index e5d8856fa..4187d8f74 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/types/Movie.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/types/Movie.kt @@ -18,11 +18,11 @@ import kotlin.jvm.JvmName public class Movie( title: () -> String? = titleDefault, ) { - private val _title: () -> String? = title + private val __title: () -> String? = title @get:JvmName("getTitle") public val title: String? - get() = _title.invoke() + get() = __title.invoke() public companion object { private val titleDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/types/Query.kt index 8a6523386..af3f060b1 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/types/Query.kt @@ -13,11 +13,11 @@ import kotlin.jvm.JvmName public class Query( search: () -> Movie? = searchDefault, ) { - private val _search: () -> Movie? = search + private val __search: () -> Movie? = search @get:JvmName("getSearch") public val search: Movie? - get() = _search.invoke() + get() = __search.invoke() public companion object { private val searchDefault: () -> Movie? = 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 7b2fbf955..5a3e8fad0 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,16 +1,20 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun search( _alias: String? = null, movieFilter: MovieFilter, _projection: MovieProjection.() -> MovieProjection, ): QueryProjection { - field(_alias, "search", MovieProjection(), _projection, "movieFilter" to movieFilter) + field(_alias, "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/types/Movie.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/types/Movie.kt index f7fcef821..3eccf4e56 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/types/Movie.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/types/Movie.kt @@ -14,14 +14,14 @@ import kotlin.jvm.JvmName public class Movie( title: () -> String? = titleDefault, ) { - private val _title: () -> String? = title + private val __title: () -> String? = title /** * The original, non localized title with some specials characters : %!({[*$,.:;. */ @get:JvmName("getTitle") public val title: String? - get() = _title.invoke() + get() = __title.invoke() public companion object { private val titleDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/types/Query.kt index 8f5978f66..7ec0b6b12 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/types/Query.kt @@ -13,11 +13,11 @@ import kotlin.jvm.JvmName public class Query( search: () -> Movie? = searchDefault, ) { - private val _search: () -> Movie? = search + private val __search: () -> Movie? = search @get:JvmName("getSearch") public val search: Movie? - get() = _search.invoke() + get() = __search.invoke() public companion object { private val searchDefault: () -> Movie? = 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 d63a002b7..c1b9249f3 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun me(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field(_alias, "me", PersonProjection(), _projection) + field(_alias, "me", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWIthNoFields/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWIthNoFields/expected/types/Query.kt index fce6a02a7..db892f7ca 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWIthNoFields/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWIthNoFields/expected/types/Query.kt @@ -13,11 +13,11 @@ import kotlin.jvm.JvmName public class Query( me: () -> Person? = meDefault, ) { - private val _me: () -> Person? = me + private val __me: () -> Person? = me @get:JvmName("getMe") public val me: Person? - get() = _me.invoke() + get() = __me.invoke() public companion object { private val meDefault: () -> Person? = 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 6374ac88f..d338b748d 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun test(_alias: String? = null, _projection: RequiredTestTypeProjection.() -> RequiredTestTypeProjection): QueryProjection { - field(_alias, "test", RequiredTestTypeProjection(), _projection) + field(_alias, "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/dataClassWithBooleanField/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/types/Query.kt index 89244579f..36ce7ee98 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/types/Query.kt @@ -13,11 +13,11 @@ import kotlin.jvm.JvmName public class Query( test: () -> RequiredTestType? = testDefault, ) { - private val _test: () -> RequiredTestType? = test + private val __test: () -> RequiredTestType? = test @get:JvmName("getTest") public val test: RequiredTestType? - get() = _test.invoke() + get() = __test.invoke() public companion object { private val testDefault: () -> RequiredTestType? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/types/RequiredTestType.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/types/RequiredTestType.kt index d7d9adb6e..bbdf6e3a4 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/types/RequiredTestType.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/types/RequiredTestType.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class RequiredTestType( isRequired: () -> Boolean = isRequiredDefault, ) { - private val _isRequired: () -> Boolean = isRequired + private val __isRequired: () -> Boolean = isRequired @get:JvmName("getIsRequired") public val isRequired: Boolean - get() = _isRequired.invoke() + get() = __isRequired.invoke() public companion object { private val isRequiredDefault: () -> Boolean = 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 5f045ee50..1d4e1fae2 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,18 +1,21 @@ 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 import kotlin.String -public class EntityConnectionProjection : GraphQLProjection() { +public class EntityConnectionProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun pageInfo(_alias: String? = null, _projection: PageInfoProjection.() -> PageInfoProjection): EntityConnectionProjection { - field(_alias, "pageInfo", PageInfoProjection(), _projection) + field(_alias, "pageInfo", PageInfoProjection(inputValueSerializer), _projection) return this } public fun edges(_alias: String? = null, _projection: EntityEdgeProjection.() -> EntityEdgeProjection): EntityConnectionProjection { - field(_alias, "edges", EntityEdgeProjection(), _projection) + field(_alias, "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 61177d3a7..be311c5af 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,9 +1,12 @@ 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 import kotlin.String -public class EntityEdgeProjection : GraphQLProjection() { +public class EntityEdgeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val cursor: EntityEdgeProjection get() { field("cursor") @@ -12,7 +15,7 @@ public class EntityEdgeProjection : GraphQLProjection() { public fun node(_alias: String? = null, _projection: EntityProjection.() -> EntityProjection): EntityEdgeProjection { - field(_alias, "node", EntityProjection(), _projection) + field(_alias, "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 1cd601c8b..b0cba58a8 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,18 +1,21 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun entity(_alias: String? = null, _projection: EntityProjection.() -> EntityProjection): QueryProjection { - field(_alias, "entity", EntityProjection(), _projection) + field(_alias, "entity", EntityProjection(inputValueSerializer), _projection) return this } public fun entityConnection(_alias: String? = null, _projection: EntityConnectionProjection.() -> EntityConnectionProjection): QueryProjection { - field(_alias, "entityConnection", EntityConnectionProjection(), _projection) + field(_alias, "entityConnection", EntityConnectionProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/Entity.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/Entity.kt index d80130622..230a6d6ea 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/Entity.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/Entity.kt @@ -16,17 +16,17 @@ public class Entity( long: () -> Long? = longDefault, dateTime: () -> OffsetDateTime? = dateTimeDefault, ) { - private val _long: () -> Long? = long + private val __long: () -> Long? = long - private val _dateTime: () -> OffsetDateTime? = dateTime + private val __dateTime: () -> OffsetDateTime? = dateTime @get:JvmName("getLong") public val long: Long? - get() = _long.invoke() + get() = __long.invoke() @get:JvmName("getDateTime") public val dateTime: OffsetDateTime? - get() = _dateTime.invoke() + get() = __dateTime.invoke() public companion object { private val longDefault: () -> Long? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/EntityConnection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/EntityConnection.kt index 9a73b05fb..3a4b40282 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/EntityConnection.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/EntityConnection.kt @@ -15,17 +15,17 @@ public class EntityConnection( pageInfo: () -> PageInfo = pageInfoDefault, edges: () -> List? = edgesDefault, ) { - private val _pageInfo: () -> PageInfo = pageInfo + private val __pageInfo: () -> PageInfo = pageInfo - private val _edges: () -> List? = edges + private val __edges: () -> List? = edges @get:JvmName("getPageInfo") public val pageInfo: PageInfo - get() = _pageInfo.invoke() + get() = __pageInfo.invoke() @get:JvmName("getEdges") public val edges: List? - get() = _edges.invoke() + get() = __edges.invoke() public companion object { private val pageInfoDefault: () -> PageInfo = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/EntityEdge.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/EntityEdge.kt index 70a35ce7d..d9e6795b7 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/EntityEdge.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/EntityEdge.kt @@ -15,17 +15,17 @@ public class EntityEdge( cursor: () -> String = cursorDefault, node: () -> Entity? = nodeDefault, ) { - private val _cursor: () -> String = cursor + private val __cursor: () -> String = cursor - private val _node: () -> Entity? = node + private val __node: () -> Entity? = node @get:JvmName("getCursor") public val cursor: String - get() = _cursor.invoke() + get() = __cursor.invoke() @get:JvmName("getNode") public val node: Entity? - get() = _node.invoke() + get() = __node.invoke() public companion object { private val cursorDefault: () -> String = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/PageInfo.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/PageInfo.kt index a615b83bf..ca5ba1ac8 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/PageInfo.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/PageInfo.kt @@ -18,29 +18,29 @@ public class PageInfo( hasNextPage: () -> Boolean = hasNextPageDefault, hasPreviousPage: () -> Boolean = hasPreviousPageDefault, ) { - private val _startCursor: () -> String? = startCursor + private val __startCursor: () -> String? = startCursor - private val _endCursor: () -> String? = endCursor + private val __endCursor: () -> String? = endCursor - private val _hasNextPage: () -> Boolean = hasNextPage + private val __hasNextPage: () -> Boolean = hasNextPage - private val _hasPreviousPage: () -> Boolean = hasPreviousPage + private val __hasPreviousPage: () -> Boolean = hasPreviousPage @get:JvmName("getStartCursor") public val startCursor: String? - get() = _startCursor.invoke() + get() = __startCursor.invoke() @get:JvmName("getEndCursor") public val endCursor: String? - get() = _endCursor.invoke() + get() = __endCursor.invoke() @get:JvmName("getHasNextPage") public val hasNextPage: Boolean - get() = _hasNextPage.invoke() + get() = __hasNextPage.invoke() @get:JvmName("getHasPreviousPage") public val hasPreviousPage: Boolean - get() = _hasPreviousPage.invoke() + get() = __hasPreviousPage.invoke() public companion object { private val startCursorDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/Query.kt index 14fc197ac..fd3142be9 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/types/Query.kt @@ -15,17 +15,17 @@ public class Query( entity: () -> List? = entityDefault, entityConnection: () -> EntityConnection? = entityConnectionDefault, ) { - private val _entity: () -> List? = entity + private val __entity: () -> List? = entity - private val _entityConnection: () -> EntityConnection? = entityConnection + private val __entityConnection: () -> EntityConnection? = entityConnection @get:JvmName("getEntity") public val entity: List? - get() = _entity.invoke() + get() = __entity.invoke() @get:JvmName("getEntityConnection") public val entityConnection: EntityConnection? - get() = _entityConnection.invoke() + get() = __entityConnection.invoke() public companion object { private val entityDefault: () -> List? = 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 b4428fb67..67b022e37 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,9 +1,12 @@ 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 import kotlin.String -public class CarProjection : GraphQLProjection() { +public class CarProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val make: CarProjection get() { field("make") @@ -18,7 +21,7 @@ public class CarProjection : GraphQLProjection() { public fun engine(_alias: String? = null, _projection: EngineProjection.() -> EngineProjection): CarProjection { - field(_alias, "engine", EngineProjection(), _projection) + field(_alias, "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 55d9178a3..d236cf8b9 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,9 +1,12 @@ 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 import kotlin.String -public class EngineProjection : GraphQLProjection() { +public class EngineProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val type: EngineProjection get() { field("type") @@ -24,7 +27,7 @@ public class EngineProjection : GraphQLProjection() { public fun performance(_alias: String? = null, _projection: PerformanceProjection.() -> PerformanceProjection): EngineProjection { - field(_alias, "performance", PerformanceProjection(), _projection) + field(_alias, "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 e62affb18..7694bb472 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun cars(_alias: String? = null, _projection: CarProjection.() -> CarProjection): QueryProjection { - field(_alias, "cars", CarProjection(), _projection) + field(_alias, "cars", CarProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/types/Car.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/types/Car.kt index eb4fcd8f8..5c889f394 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/types/Car.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/types/Car.kt @@ -16,23 +16,23 @@ public class Car( model: () -> String? = modelDefault, engine: () -> Engine? = engineDefault, ) { - private val _make: () -> String? = make + private val __make: () -> String? = make - private val _model: () -> String? = model + private val __model: () -> String? = model - private val _engine: () -> Engine? = engine + private val __engine: () -> Engine? = engine @get:JvmName("getMake") public val make: String? - get() = _make.invoke() + get() = __make.invoke() @get:JvmName("getModel") public val model: String? - get() = _model.invoke() + get() = __model.invoke() @get:JvmName("getEngine") public val engine: Engine? - get() = _engine.invoke() + get() = __engine.invoke() public companion object { private val makeDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/types/Engine.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/types/Engine.kt index 6580218ac..dc946af3f 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/types/Engine.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/types/Engine.kt @@ -19,29 +19,29 @@ public class Engine( size: () -> Double? = sizeDefault, performance: () -> Performance? = performanceDefault, ) { - private val _type: () -> String? = type + private val __type: () -> String? = type - private val _bhp: () -> Int? = bhp + private val __bhp: () -> Int? = bhp - private val _size: () -> Double? = size + private val __size: () -> Double? = size - private val _performance: () -> Performance? = performance + private val __performance: () -> Performance? = performance @get:JvmName("getType") public val type: String? - get() = _type.invoke() + get() = __type.invoke() @get:JvmName("getBhp") public val bhp: Int? - get() = _bhp.invoke() + get() = __bhp.invoke() @get:JvmName("getSize") public val size: Double? - get() = _size.invoke() + get() = __size.invoke() @get:JvmName("getPerformance") public val performance: Performance? - get() = _performance.invoke() + get() = __performance.invoke() public companion object { private val typeDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/types/Performance.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/types/Performance.kt index 78b85ad20..26ee302cd 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/types/Performance.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/types/Performance.kt @@ -15,17 +15,17 @@ public class Performance( zeroToSixty: () -> Double? = zeroToSixtyDefault, quarterMile: () -> Double? = quarterMileDefault, ) { - private val _zeroToSixty: () -> Double? = zeroToSixty + private val __zeroToSixty: () -> Double? = zeroToSixty - private val _quarterMile: () -> Double? = quarterMile + private val __quarterMile: () -> Double? = quarterMile @get:JvmName("getZeroToSixty") public val zeroToSixty: Double? - get() = _zeroToSixty.invoke() + get() = __zeroToSixty.invoke() @get:JvmName("getQuarterMile") public val quarterMile: Double? - get() = _quarterMile.invoke() + get() = __quarterMile.invoke() public companion object { private val zeroToSixtyDefault: () -> Double? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/types/Query.kt index d1a4a477d..bc0ecff11 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( cars: () -> List? = carsDefault, ) { - private val _cars: () -> List? = cars + private val __cars: () -> List? = cars @get:JvmName("getCars") public val cars: List? - get() = _cars.invoke() + get() = __cars.invoke() public companion object { private val carsDefault: () -> List? = 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 f64d676df..39e5eca4d 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field(_alias, "people", PersonProjection(), _projection) + field(_alias, "people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithExtendedInterface/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithExtendedInterface/expected/types/Query.kt index f90860317..dc2a57029 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithExtendedInterface/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithExtendedInterface/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( people: () -> List? = peopleDefault, ) { - private val _people: () -> List? = people + private val __people: () -> List? = people @get:JvmName("getPeople") public val people: List? - get() = _people.invoke() + get() = __people.invoke() public companion object { private val peopleDefault: () -> List? = 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 30b7bd26b..af8df4fed 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field(_alias, "people", PersonProjection(), _projection) + field(_alias, "people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/types/Employee.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/types/Employee.kt index ee992c7be..5f70b1a8b 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/types/Employee.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/types/Employee.kt @@ -17,25 +17,25 @@ public class Employee( lastname: () -> String? = lastnameDefault, company: () -> String? = companyDefault, ) : Person { - private val _firstname: () -> String? = firstname + private val __firstname: () -> String? = firstname - private val _lastname: () -> String? = lastname + private val __lastname: () -> String? = lastname - private val _company: () -> String? = company + private val __company: () -> String? = company @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getFirstname") override val firstname: String? - get() = _firstname.invoke() + get() = __firstname.invoke() @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getLastname") override val lastname: String? - get() = _lastname.invoke() + get() = __lastname.invoke() @get:JvmName("getCompany") public val company: String? - get() = _company.invoke() + get() = __company.invoke() public companion object { private val firstnameDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/types/Query.kt index 1e66b0eb4..5b65be1c7 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( people: () -> List? = peopleDefault, ) { - private val _people: () -> List? = people + private val __people: () -> List? = people @get:JvmName("getPeople") public val people: List? - get() = _people.invoke() + get() = __people.invoke() public companion object { private val peopleDefault: () -> List? = 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 193f1aff0..b2dec68dd 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field(_alias, "people", PersonProjection(), _projection) + field(_alias, "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/dataClassWithInterfaceInheritance/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/types/Query.kt index 14b5114da..7867d28a7 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( people: () -> List? = peopleDefault, ) { - private val _people: () -> List? = people + private val __people: () -> List? = people @get:JvmName("getPeople") public val people: List? - get() = _people.invoke() + get() = __people.invoke() public companion object { private val peopleDefault: () -> List? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/types/Talent.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/types/Talent.kt index 3f82268e0..1ac44dd4d 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/types/Talent.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/types/Talent.kt @@ -18,32 +18,32 @@ public class Talent( company: () -> String? = companyDefault, imdbProfile: () -> String? = imdbProfileDefault, ) : Employee { - private val _firstname: () -> String = firstname + private val __firstname: () -> String = firstname - private val _lastname: () -> String? = lastname + private val __lastname: () -> String? = lastname - private val _company: () -> String? = company + private val __company: () -> String? = company - private val _imdbProfile: () -> String? = imdbProfile + private val __imdbProfile: () -> String? = imdbProfile @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getFirstname") override val firstname: String - get() = _firstname.invoke() + get() = __firstname.invoke() @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getLastname") override val lastname: String? - get() = _lastname.invoke() + get() = __lastname.invoke() @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getCompany") override val company: String? - get() = _company.invoke() + get() = __company.invoke() @get:JvmName("getImdbProfile") public val imdbProfile: String? - get() = _imdbProfile.invoke() + get() = __imdbProfile.invoke() public companion object { private val firstnameDefault: () -> String = 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 118a11483..94c556c08 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field(_alias, "people", PersonProjection(), _projection) + field(_alias, "people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/types/Person.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/types/Person.kt index fb3e4bae0..a742e5432 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/types/Person.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/types/Person.kt @@ -16,17 +16,17 @@ public class Person( name: () -> String? = nameDefault, email: () -> List? = emailDefault, ) { - private val _name: () -> String? = name + private val __name: () -> String? = name - private val _email: () -> List? = email + private val __email: () -> List? = email @get:JvmName("getName") public val name: String? - get() = _name.invoke() + get() = __name.invoke() @get:JvmName("getEmail") public val email: List? - get() = _email.invoke() + get() = __email.invoke() public companion object { private val nameDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/types/Query.kt index 402f323cb..7a54b5385 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( people: () -> List? = peopleDefault, ) { - private val _people: () -> List? = people + private val __people: () -> List? = people @get:JvmName("getPeople") public val people: List? - get() = _people.invoke() + get() = __people.invoke() public companion object { private val peopleDefault: () -> List? = 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 b604e143b..2fe3581d1 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun products(_alias: String? = null, _projection: ProductProjection.() -> ProductProjection): QueryProjection { - field(_alias, "products", ProductProjection(), _projection) + field(_alias, "products", ProductProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/types/Product.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/types/Product.kt index 5c91eead8..117c7d593 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/types/Product.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/types/Product.kt @@ -16,12 +16,12 @@ import kotlin.jvm.JvmName public class Product( id: () -> String = idDefault, ) : Entity, Node { - private val _id: () -> String = id + private val __id: () -> String = id @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getId") override val id: String - get() = _id.invoke() + get() = __id.invoke() public companion object { private val idDefault: () -> String = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/types/Query.kt index 85dc7937c..da5e51e89 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( products: () -> List? = productsDefault, ) { - private val _products: () -> List? = products + private val __products: () -> List? = products @get:JvmName("getProducts") public val products: List? - get() = _products.invoke() + get() = __products.invoke() public companion object { private val productsDefault: () -> List? = 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 e1d014458..77ba0aacc 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,18 +1,21 @@ 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 import kotlin.String -public class EntityConnectionProjection : GraphQLProjection() { +public class EntityConnectionProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun pageInfo(_alias: String? = null, _projection: PageInfoProjection.() -> PageInfoProjection): EntityConnectionProjection { - field(_alias, "pageInfo", PageInfoProjection(), _projection) + field(_alias, "pageInfo", PageInfoProjection(inputValueSerializer), _projection) return this } public fun edges(_alias: String? = null, _projection: EntityEdgeProjection.() -> EntityEdgeProjection): EntityConnectionProjection { - field(_alias, "edges", EntityEdgeProjection(), _projection) + field(_alias, "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 2aedb416f..bcedfad22 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,9 +1,12 @@ 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 import kotlin.String -public class EntityEdgeProjection : GraphQLProjection() { +public class EntityEdgeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val cursor: EntityEdgeProjection get() { field("cursor") @@ -12,7 +15,7 @@ public class EntityEdgeProjection : GraphQLProjection() { public fun node(_alias: String? = null, _projection: EntityProjection.() -> EntityProjection): EntityEdgeProjection { - field(_alias, "node", EntityProjection(), _projection) + field(_alias, "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 6e2924cb7..789d1d023 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,18 +1,21 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun entity(_alias: String? = null, _projection: EntityProjection.() -> EntityProjection): QueryProjection { - field(_alias, "entity", EntityProjection(), _projection) + field(_alias, "entity", EntityProjection(inputValueSerializer), _projection) return this } public fun entityConnection(_alias: String? = null, _projection: EntityConnectionProjection.() -> EntityConnectionProjection): QueryProjection { - field(_alias, "entityConnection", EntityConnectionProjection(), _projection) + field(_alias, "entityConnection", EntityConnectionProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/types/Entity.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/types/Entity.kt index 5e6bb926c..ba5a5ab50 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/types/Entity.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/types/Entity.kt @@ -16,17 +16,17 @@ public class Entity( long: () -> Long? = longDefault, dateTime: () -> OffsetDateTime? = dateTimeDefault, ) { - private val _long: () -> Long? = long + private val __long: () -> Long? = long - private val _dateTime: () -> OffsetDateTime? = dateTime + private val __dateTime: () -> OffsetDateTime? = dateTime @get:JvmName("getLong") public val long: Long? - get() = _long.invoke() + get() = __long.invoke() @get:JvmName("getDateTime") public val dateTime: OffsetDateTime? - get() = _dateTime.invoke() + get() = __dateTime.invoke() public companion object { private val longDefault: () -> Long? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/types/EntityEdge.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/types/EntityEdge.kt index f15a0df86..f3b0aee39 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/types/EntityEdge.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/types/EntityEdge.kt @@ -15,17 +15,17 @@ public class EntityEdge( cursor: () -> String = cursorDefault, node: () -> Entity? = nodeDefault, ) { - private val _cursor: () -> String = cursor + private val __cursor: () -> String = cursor - private val _node: () -> Entity? = node + private val __node: () -> Entity? = node @get:JvmName("getCursor") public val cursor: String - get() = _cursor.invoke() + get() = __cursor.invoke() @get:JvmName("getNode") public val node: Entity? - get() = _node.invoke() + get() = __node.invoke() public companion object { private val cursorDefault: () -> String = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/types/Query.kt index 09c9e59db..08140206c 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedTypes/expected/types/Query.kt @@ -16,17 +16,17 @@ public class Query( entity: () -> List? = entityDefault, entityConnection: () -> SimpleListConnection? = entityConnectionDefault, ) { - private val _entity: () -> List? = entity + private val __entity: () -> List? = entity - private val _entityConnection: () -> SimpleListConnection? = entityConnection + private val __entityConnection: () -> SimpleListConnection? = entityConnection @get:JvmName("getEntity") public val entity: List? - get() = _entity.invoke() + get() = __entity.invoke() @get:JvmName("getEntityConnection") public val entityConnection: SimpleListConnection? - get() = _entityConnection.invoke() + get() = __entityConnection.invoke() public companion object { private val entityDefault: () -> List? = 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 849286d6a..b53a88b19 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field(_alias, "people", PersonProjection(), _projection) + field(_alias, "people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/types/Employee.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/types/Employee.kt index 99670238a..9b5963796 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/types/Employee.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/types/Employee.kt @@ -17,26 +17,26 @@ public class Employee( lastname: () -> String = lastnameDefault, company: () -> String? = companyDefault, ) : Person { - private val _firstname: () -> String = firstname + private val __firstname: () -> String = firstname - private val _lastname: () -> String = lastname + private val __lastname: () -> String = lastname - private val _company: () -> String? = company + private val __company: () -> String? = company @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getFirstname") override val firstname: String - get() = _firstname.invoke() + get() = __firstname.invoke() @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getLastname") override val lastname: String - get() = _lastname.invoke() + get() = __lastname.invoke() @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getCompany") override val company: String? - get() = _company.invoke() + get() = __company.invoke() public companion object { private val firstnameDefault: () -> String = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/types/Query.kt index bfe86af37..58d543898 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableAndInterface/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( people: () -> List? = peopleDefault, ) { - private val _people: () -> List? = people + private val __people: () -> List? = people @get:JvmName("getPeople") public val people: List? - get() = _people.invoke() + get() = __people.invoke() public companion object { private val peopleDefault: () -> List? = 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 d67e98843..a5d9473b4 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,12 +1,15 @@ 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 import kotlin.String -public class MyTypeProjection : GraphQLProjection() { +public class MyTypeProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun other(_alias: String? = null, _projection: OtherTypeProjection.() -> OtherTypeProjection): MyTypeProjection { - field(_alias, "other", OtherTypeProjection(), _projection) + field(_alias, "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/dataClassWithNonNullableComplexType/expected/types/MyType.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableComplexType/expected/types/MyType.kt index 255edab51..15667e391 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableComplexType/expected/types/MyType.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableComplexType/expected/types/MyType.kt @@ -13,11 +13,11 @@ import kotlin.jvm.JvmName public class MyType( other: () -> OtherType = otherDefault, ) { - private val _other: () -> OtherType = other + private val __other: () -> OtherType = other @get:JvmName("getOther") public val other: OtherType - get() = _other.invoke() + get() = __other.invoke() public companion object { private val otherDefault: () -> OtherType = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableComplexType/expected/types/OtherType.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableComplexType/expected/types/OtherType.kt index 1684514cb..0cb8dbc4d 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableComplexType/expected/types/OtherType.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableComplexType/expected/types/OtherType.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class OtherType( name: () -> String = nameDefault, ) { - private val _name: () -> String = name + private val __name: () -> String = name @get:JvmName("getName") public val name: String - get() = _name.invoke() + get() = __name.invoke() public companion object { private val nameDefault: () -> String = 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 ea3565c01..6db6bfc60 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field(_alias, "people", PersonProjection(), _projection) + field(_alias, "people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/types/Person.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/types/Person.kt index 0e0b9adf9..841d9c234 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/types/Person.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/types/Person.kt @@ -16,17 +16,17 @@ public class Person( name: () -> String = nameDefault, email: () -> List = emailDefault, ) { - private val _name: () -> String = name + private val __name: () -> String = name - private val _email: () -> List = email + private val __email: () -> List = email @get:JvmName("getName") public val name: String - get() = _name.invoke() + get() = __name.invoke() @get:JvmName("getEmail") public val email: List - get() = _email.invoke() + get() = __email.invoke() public companion object { private val nameDefault: () -> String = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/types/Query.kt index 5cc99d579..066bccc92 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableListOfNullableValues/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( people: () -> List? = peopleDefault, ) { - private val _people: () -> List? = people + private val __people: () -> List? = people @get:JvmName("getPeople") public val people: List? - get() = _people.invoke() + get() = __people.invoke() public companion object { private val peopleDefault: () -> List? = 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/dataClassWithNonNullablePrimitive/expected/types/MyType.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullablePrimitive/expected/types/MyType.kt index a6d7a0ba8..a17e3efa7 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullablePrimitive/expected/types/MyType.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullablePrimitive/expected/types/MyType.kt @@ -18,23 +18,23 @@ public class MyType( truth: () -> Boolean = truthDefault, floaty: () -> Double = floatyDefault, ) { - private val _count: () -> Int = count + private val __count: () -> Int = count - private val _truth: () -> Boolean = truth + private val __truth: () -> Boolean = truth - private val _floaty: () -> Double = floaty + private val __floaty: () -> Double = floaty @get:JvmName("getCount") public val count: Int - get() = _count.invoke() + get() = __count.invoke() @get:JvmName("getTruth") public val truth: Boolean - get() = _truth.invoke() + get() = __truth.invoke() @get:JvmName("getFloaty") public val floaty: Double - get() = _floaty.invoke() + get() = __floaty.invoke() public companion object { private val countDefault: () -> Int = 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/dataClassWithNonNullablePrimitiveInList/expected/types/MyType.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullablePrimitiveInList/expected/types/MyType.kt index f51738fdb..d071010cd 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullablePrimitiveInList/expected/types/MyType.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullablePrimitiveInList/expected/types/MyType.kt @@ -19,23 +19,23 @@ public class MyType( truth: () -> List? = truthDefault, floaty: () -> List? = floatyDefault, ) { - private val _count: () -> List? = count + private val __count: () -> List? = count - private val _truth: () -> List? = truth + private val __truth: () -> List? = truth - private val _floaty: () -> List? = floaty + private val __floaty: () -> List? = floaty @get:JvmName("getCount") public val count: List? - get() = _count.invoke() + get() = __count.invoke() @get:JvmName("getTruth") public val truth: List? - get() = _truth.invoke() + get() = __truth.invoke() @get:JvmName("getFloaty") public val floaty: List? - get() = _floaty.invoke() + get() = __floaty.invoke() public companion object { private val countDefault: () -> List? = 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 17b30b1a1..1e85991f5 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field(_alias, "people", PersonProjection(), _projection) + field(_alias, "people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/types/Person.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/types/Person.kt index 2b91cee5b..f139b0693 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/types/Person.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/types/Person.kt @@ -16,17 +16,17 @@ public class Person( name: () -> String = nameDefault, email: () -> List = emailDefault, ) { - private val _name: () -> String = name + private val __name: () -> String = name - private val _email: () -> List = email + private val __email: () -> List = email @get:JvmName("getName") public val name: String - get() = _name.invoke() + get() = __name.invoke() @get:JvmName("getEmail") public val email: List - get() = _email.invoke() + get() = __email.invoke() public companion object { private val nameDefault: () -> String = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/types/Query.kt index 483375ba2..f15ff2727 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNonNullableProperties/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( people: () -> List? = peopleDefault, ) { - private val _people: () -> List? = people + private val __people: () -> List? = people @get:JvmName("getPeople") public val people: List? - get() = _people.invoke() + get() = __people.invoke() public companion object { private val peopleDefault: () -> List? = 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/dataClassWithNullablePrimitive/expected/types/MyType.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNullablePrimitive/expected/types/MyType.kt index c20e98857..f8b4bb3a6 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNullablePrimitive/expected/types/MyType.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithNullablePrimitive/expected/types/MyType.kt @@ -18,23 +18,23 @@ public class MyType( truth: () -> Boolean? = truthDefault, floaty: () -> Double? = floatyDefault, ) { - private val _count: () -> Int? = count + private val __count: () -> Int? = count - private val _truth: () -> Boolean? = truth + private val __truth: () -> Boolean? = truth - private val _floaty: () -> Double? = floaty + private val __floaty: () -> Double? = floaty @get:JvmName("getCount") public val count: Int? - get() = _count.invoke() + get() = __count.invoke() @get:JvmName("getTruth") public val truth: Boolean? - get() = _truth.invoke() + get() = __truth.invoke() @get:JvmName("getFloaty") public val floaty: Double? - get() = _floaty.invoke() + get() = __floaty.invoke() public companion object { private val countDefault: () -> Int? = 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 bf1a084f8..07a41033a 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,9 +1,12 @@ 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 import kotlin.String -public class PersonProjection : GraphQLProjection() { +public class PersonProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val firstname: PersonProjection get() { field("firstname") @@ -18,7 +21,7 @@ public class PersonProjection : GraphQLProjection() { public fun friends(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): PersonProjection { - field(_alias, "friends", PersonProjection(), _projection) + field(_alias, "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 a85774072..6bc9c817f 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field(_alias, "people", PersonProjection(), _projection) + field(_alias, "people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/types/Person.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/types/Person.kt index 05d8e5563..7d42d8e45 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/types/Person.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/types/Person.kt @@ -17,23 +17,23 @@ public class Person( lastname: () -> String? = lastnameDefault, friends: () -> List? = friendsDefault, ) { - private val _firstname: () -> String? = firstname + private val __firstname: () -> String? = firstname - private val _lastname: () -> String? = lastname + private val __lastname: () -> String? = lastname - private val _friends: () -> List? = friends + private val __friends: () -> List? = friends @get:JvmName("getFirstname") public val firstname: String? - get() = _firstname.invoke() + get() = __firstname.invoke() @get:JvmName("getLastname") public val lastname: String? - get() = _lastname.invoke() + get() = __lastname.invoke() @get:JvmName("getFriends") public val friends: List? - get() = _friends.invoke() + get() = __friends.invoke() public companion object { private val firstnameDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/types/Query.kt index fef124d9f..6b42ed25b 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithRecursiveField/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( people: () -> List? = peopleDefault, ) { - private val _people: () -> List? = people + private val __people: () -> List? = people @get:JvmName("getPeople") public val people: List? - get() = _people.invoke() + get() = __people.invoke() public companion object { private val peopleDefault: () -> List? = 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/dataClassWithReservedWord/expected/types/SampleType.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithReservedWord/expected/types/SampleType.kt index 3ef76ebca..699e30e12 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithReservedWord/expected/types/SampleType.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithReservedWord/expected/types/SampleType.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class SampleType( `return`: () -> String = returnDefault, ) { - private val _return: () -> String = `return` + private val __return: () -> String = `return` @get:JvmName("getReturn") public val `return`: String - get() = _return.invoke() + get() = __return.invoke() public companion object { private val returnDefault: () -> String = 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 77ba8cd9a..8fb93136d 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field(_alias, "people", PersonProjection(), _projection) + field(_alias, "people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/types/Person.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/types/Person.kt index a6bb21f5e..405536eec 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/types/Person.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/types/Person.kt @@ -15,17 +15,17 @@ public class Person( firstname: () -> String? = firstnameDefault, lastname: () -> String? = lastnameDefault, ) { - private val _firstname: () -> String? = firstname + private val __firstname: () -> String? = firstname - private val _lastname: () -> String? = lastname + private val __lastname: () -> String? = lastname @get:JvmName("getFirstname") public val firstname: String? - get() = _firstname.invoke() + get() = __firstname.invoke() @get:JvmName("getLastname") public val lastname: String? - get() = _lastname.invoke() + get() = __lastname.invoke() public companion object { private val firstnameDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/types/Query.kt index d28b0348b..cf301f463 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithStringProperties/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( people: () -> List? = peopleDefault, ) { - private val _people: () -> List? = people + private val __people: () -> List? = people @get:JvmName("getPeople") public val people: List? - get() = _people.invoke() + get() = __people.invoke() public companion object { private val peopleDefault: () -> List? = 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/enum/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enum/expected/types/Query.kt index 58137f1a6..a2a54247e 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enum/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enum/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( types: () -> List? = typesDefault, ) { - private val _types: () -> List? = types + private val __types: () -> List? = types @get:JvmName("getTypes") public val types: List? - get() = _types.invoke() + get() = __types.invoke() public companion object { private val typesDefault: () -> List? = 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/enumWithExtendedType/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enumWithExtendedType/expected/types/Query.kt index aa3a35be7..78a571824 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enumWithExtendedType/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/enumWithExtendedType/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( types: () -> List? = typesDefault, ) { - private val _types: () -> List? = types + private val __types: () -> List? = types @get:JvmName("getTypes") public val types: List? - get() = _types.invoke() + get() = __types.invoke() public companion object { private val typesDefault: () -> List? = 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/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/expected/types/Query.kt index 748489890..de7e357bf 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/input/expected/types/Query.kt @@ -15,11 +15,11 @@ import kotlin.jvm.JvmName public class Query( movies: () -> List? = moviesDefault, ) { - private val _movies: () -> List? = movies + private val __movies: () -> List? = movies @get:JvmName("getMovies") public val movies: List? - get() = _movies.invoke() + get() = __movies.invoke() public companion object { private val moviesDefault: () -> List? = 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/inputWithExtendedType/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/inputWithExtendedType/expected/types/Query.kt index 68469fe58..1d4210065 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/inputWithExtendedType/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/inputWithExtendedType/expected/types/Query.kt @@ -15,11 +15,11 @@ import kotlin.jvm.JvmName public class Query( movies: () -> List? = moviesDefault, ) { - private val _movies: () -> List? = movies + private val __movies: () -> List? = movies @get:JvmName("getMovies") public val movies: List? - get() = _movies.invoke() + get() = __movies.invoke() public companion object { private val moviesDefault: () -> List? = 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 a6b2f666e..1a8ca612f 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,9 +1,12 @@ 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 import kotlin.String -public class BirdProjection : GraphQLProjection() { +public class BirdProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val id: BirdProjection get() { field("id") @@ -24,19 +27,19 @@ public class BirdProjection : GraphQLProjection() { public fun mother(_alias: String? = null, _projection: BirdProjection.() -> BirdProjection): BirdProjection { - field(_alias, "mother", BirdProjection(), _projection) + field(_alias, "mother", BirdProjection(inputValueSerializer), _projection) return this } public fun father(_alias: String? = null, _projection: BirdProjection.() -> BirdProjection): BirdProjection { - field(_alias, "father", BirdProjection(), _projection) + field(_alias, "father", BirdProjection(inputValueSerializer), _projection) return this } public fun parents(_alias: String? = null, _projection: BirdProjection.() -> BirdProjection): BirdProjection { - field(_alias, "parents", BirdProjection(), _projection) + field(_alias, "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 4861c6da5..209cce175 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,9 +1,12 @@ 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 import kotlin.String -public class DogProjection : GraphQLProjection() { +public class DogProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val id: DogProjection get() { field("id") @@ -24,19 +27,19 @@ public class DogProjection : GraphQLProjection() { public fun mother(_alias: String? = null, _projection: DogProjection.() -> DogProjection): DogProjection { - field(_alias, "mother", DogProjection(), _projection) + field(_alias, "mother", DogProjection(inputValueSerializer), _projection) return this } public fun father(_alias: String? = null, _projection: DogProjection.() -> DogProjection): DogProjection { - field(_alias, "father", DogProjection(), _projection) + field(_alias, "father", DogProjection(inputValueSerializer), _projection) return this } public fun parents(_alias: String? = null, _projection: DogProjection.() -> DogProjection): DogProjection { - field(_alias, "parents", DogProjection(), _projection) + field(_alias, "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 df1ad3f6e..0563bdb4c 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,9 +1,12 @@ 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 import kotlin.String -public class PetProjection : GraphQLProjection() { +public class PetProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val id: PetProjection get() { field("id") @@ -24,19 +27,19 @@ public class PetProjection : GraphQLProjection() { public fun mother(_alias: String? = null, _projection: PetProjection.() -> PetProjection): PetProjection { - field(_alias, "mother", PetProjection(), _projection) + field(_alias, "mother", PetProjection(inputValueSerializer), _projection) return this } public fun father(_alias: String? = null, _projection: PetProjection.() -> PetProjection): PetProjection { - field(_alias, "father", PetProjection(), _projection) + field(_alias, "father", PetProjection(inputValueSerializer), _projection) return this } public fun parents(_alias: String? = null, _projection: PetProjection.() -> PetProjection): PetProjection { - field(_alias, "parents", PetProjection(), _projection) + field(_alias, "parents", PetProjection(inputValueSerializer), _projection) return this } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/types/Bird.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/types/Bird.kt index 034d513d4..63bd7eadf 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/types/Bird.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/types/Bird.kt @@ -21,47 +21,47 @@ public class Bird( father: () -> Bird? = fatherDefault, parents: () -> List? = parentsDefault, ) : Pet { - private val _id: () -> String = id + private val __id: () -> String = id - private val _name: () -> String? = name + private val __name: () -> String? = name - private val _address: () -> List = address + private val __address: () -> List = address - private val _mother: () -> Bird = mother + private val __mother: () -> Bird = mother - private val _father: () -> Bird? = father + private val __father: () -> Bird? = father - private val _parents: () -> List? = parents + private val __parents: () -> List? = parents @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getId") override val id: String - get() = _id.invoke() + get() = __id.invoke() @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getName") override val name: String? - get() = _name.invoke() + get() = __name.invoke() @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getAddress") override val address: List - get() = _address.invoke() + get() = __address.invoke() @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getMother") override val mother: Bird - get() = _mother.invoke() + get() = __mother.invoke() @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getFather") override val father: Bird? - get() = _father.invoke() + get() = __father.invoke() @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getParents") override val parents: List? - get() = _parents.invoke() + get() = __parents.invoke() public companion object { private val idDefault: () -> String = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/types/Dog.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/types/Dog.kt index 3f701e7fe..6c9eefcb5 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/types/Dog.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFields/expected/types/Dog.kt @@ -21,47 +21,47 @@ public class Dog( father: () -> Dog? = fatherDefault, parents: () -> List? = parentsDefault, ) : Pet { - private val _id: () -> String = id + private val __id: () -> String = id - private val _name: () -> String? = name + private val __name: () -> String? = name - private val _address: () -> List = address + private val __address: () -> List = address - private val _mother: () -> Dog = mother + private val __mother: () -> Dog = mother - private val _father: () -> Dog? = father + private val __father: () -> Dog? = father - private val _parents: () -> List? = parents + private val __parents: () -> List? = parents @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getId") override val id: String - get() = _id.invoke() + get() = __id.invoke() @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getName") override val name: String? - get() = _name.invoke() + get() = __name.invoke() @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getAddress") override val address: List - get() = _address.invoke() + get() = __address.invoke() @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getMother") override val mother: Dog - get() = _mother.invoke() + get() = __mother.invoke() @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getFather") override val father: Dog? - get() = _father.invoke() + get() = __father.invoke() @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getParents") override val parents: List? - get() = _parents.invoke() + get() = __parents.invoke() public companion object { private val idDefault: () -> String = 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 8c536d2ea..637f33ab8 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,9 +1,12 @@ 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 import kotlin.String -public class DogProjection : GraphQLProjection() { +public class DogProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val name: DogProjection get() { field("name") @@ -12,7 +15,7 @@ public class DogProjection : GraphQLProjection() { public fun diet(_alias: String? = null, _projection: VegetarianProjection.() -> VegetarianProjection): DogProjection { - field(_alias, "diet", VegetarianProjection(), _projection) + field(_alias, "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 c4f1886a4..53625ba2a 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,9 +1,12 @@ 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 import kotlin.String -public class PetProjection : GraphQLProjection() { +public class PetProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val name: PetProjection get() { field("name") @@ -12,7 +15,7 @@ public class PetProjection : GraphQLProjection() { public fun diet(_alias: String? = null, _projection: DietProjection.() -> DietProjection): PetProjection { - field(_alias, "diet", DietProjection(), _projection) + field(_alias, "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/interfaceClassWithInterfaceFieldsOfDifferentType/expected/types/Dog.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/types/Dog.kt index e0410728b..4c7102d3e 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/types/Dog.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/types/Dog.kt @@ -16,19 +16,19 @@ public class Dog( name: () -> String? = nameDefault, diet: () -> Vegetarian? = dietDefault, ) : Pet { - private val _name: () -> String? = name + private val __name: () -> String? = name - private val _diet: () -> Vegetarian? = diet + private val __diet: () -> Vegetarian? = diet @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getName") override val name: String? - get() = _name.invoke() + get() = __name.invoke() @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getDiet") override val diet: Vegetarian? - get() = _diet.invoke() + get() = __diet.invoke() public companion object { private val nameDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/types/Vegetarian.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/types/Vegetarian.kt index 393dcedc7..20f2c78ff 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/types/Vegetarian.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithInterfaceFieldsOfDifferentType/expected/types/Vegetarian.kt @@ -17,18 +17,18 @@ public class Vegetarian( calories: () -> String? = caloriesDefault, vegetables: () -> List? = vegetablesDefault, ) : Diet { - private val _calories: () -> String? = calories + private val __calories: () -> String? = calories - private val _vegetables: () -> List? = vegetables + private val __vegetables: () -> List? = vegetables @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getCalories") override val calories: String? - get() = _calories.invoke() + get() = __calories.invoke() @get:JvmName("getVegetables") public val vegetables: List? - get() = _vegetables.invoke() + get() = __vegetables.invoke() public companion object { private val caloriesDefault: () -> String? = 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 7045b9412..2589235f5 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field(_alias, "people", PersonProjection(), _projection) + field(_alias, "people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/types/Employee.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/types/Employee.kt index d14d5d3e7..708eacd83 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/types/Employee.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/types/Employee.kt @@ -17,25 +17,25 @@ public class Employee( lastname: () -> String? = lastnameDefault, company: () -> String? = companyDefault, ) : Person { - private val _firstname: () -> String = firstname + private val __firstname: () -> String = firstname - private val _lastname: () -> String? = lastname + private val __lastname: () -> String? = lastname - private val _company: () -> String? = company + private val __company: () -> String? = company @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getFirstname") override val firstname: String - get() = _firstname.invoke() + get() = __firstname.invoke() @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getLastname") override val lastname: String? - get() = _lastname.invoke() + get() = __lastname.invoke() @get:JvmName("getCompany") public val company: String? - get() = _company.invoke() + get() = __company.invoke() public companion object { private val firstnameDefault: () -> String = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/types/Query.kt index f32c05ada..946d66eed 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceClassWithNonNullableFields/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( people: () -> List? = peopleDefault, ) { - private val _people: () -> List? = people + private val __people: () -> List? = people @get:JvmName("getPeople") public val people: List? - get() = _people.invoke() + get() = __people.invoke() public companion object { private val peopleDefault: () -> List? = 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 254ec9adf..9b9201b66 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,12 +1,15 @@ 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 import kotlin.String -public class FruitProjection : GraphQLProjection() { +public class FruitProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun seeds(_alias: String? = null, _projection: SeedProjection.() -> SeedProjection): FruitProjection { - field(_alias, "seeds", SeedProjection(), _projection) + field(_alias, "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 94503020c..102203ef0 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun fruits(_alias: String? = null, _projection: FruitProjection.() -> FruitProjection): QueryProjection { - field(_alias, "fruits", FruitProjection(), _projection) + field(_alias, "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 6e89892f2..68b786b68 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,9 +1,12 @@ 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 import kotlin.String -public class StoneFruitProjection : GraphQLProjection() { +public class StoneFruitProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public val fuzzy: StoneFruitProjection get() { field("fuzzy") @@ -12,7 +15,7 @@ public class StoneFruitProjection : GraphQLProjection() { public fun seeds(_alias: String? = null, _projection: SeedProjection.() -> SeedProjection): StoneFruitProjection { - field(_alias, "seeds", SeedProjection(), _projection) + field(_alias, "seeds", SeedProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/types/Query.kt index 8abc2fab7..030db067f 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( fruits: () -> List? = fruitsDefault, ) { - private val _fruits: () -> List? = fruits + private val __fruits: () -> List? = fruits @get:JvmName("getFruits") public val fruits: List? - get() = _fruits.invoke() + get() = __fruits.invoke() public companion object { private val fruitsDefault: () -> List? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/types/Seed.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/types/Seed.kt index 5753c7835..409208901 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/types/Seed.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithInterfaceInheritance/expected/types/Seed.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Seed( name: () -> String? = nameDefault, ) { - private val _name: () -> String? = name + private val __name: () -> String? = name @get:JvmName("getName") public val name: String? - get() = _name.invoke() + get() = __name.invoke() public companion object { private val nameDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/DgsClient.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/DgsClient.kt new file mode 100644 index 000000000..95979d83e --- /dev/null +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/DgsClient.kt @@ -0,0 +1,14 @@ +package com.netflix.graphql.dgs.codegen.cases.interfaceWithUnderscoreFields.expected + +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface +import com.netflix.graphql.dgs.codegen.GraphQLProjection +import com.netflix.graphql.dgs.codegen.cases.interfaceWithUnderscoreFields.expected.client.QueryProjection +import graphql.language.OperationDefinition +import kotlin.String + +public object DgsClient { + 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/interfaceWithUnderscoreFields/expected/DgsConstants.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/DgsConstants.kt new file mode 100644 index 000000000..960640425 --- /dev/null +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/DgsConstants.kt @@ -0,0 +1,27 @@ +package com.netflix.graphql.dgs.codegen.cases.interfaceWithUnderscoreFields.expected + +import kotlin.String + +public object DgsConstants { + public const val QUERY_TYPE: String = "Query" + + public object QUERY { + public const val TYPE_NAME: String = "Query" + + public const val Is: String = "is" + } + + public object T { + public const val TYPE_NAME: String = "T" + + public const val _id: String = "_id" + + public const val Id: String = "id" + } + + public object I { + public const val TYPE_NAME: String = "I" + + public const val _id: String = "_id" + } +} diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/client/IProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/client/IProjection.kt new file mode 100644 index 000000000..96585c3c8 --- /dev/null +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/client/IProjection.kt @@ -0,0 +1,19 @@ +package com.netflix.graphql.dgs.codegen.cases.interfaceWithUnderscoreFields.expected.client + +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface +import com.netflix.graphql.dgs.codegen.GraphQLProjection + +public class IProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { + public val _id: IProjection + get() { + field("_id") + return this + } + + public fun onT(_projection: TProjection.() -> TProjection): IProjection { + fragment("T", TProjection(), _projection) + return this + } +} diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/client/QueryProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/client/QueryProjection.kt new file mode 100644 index 000000000..1d5e52431 --- /dev/null +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/client/QueryProjection.kt @@ -0,0 +1,15 @@ +package com.netflix.graphql.dgs.codegen.cases.interfaceWithUnderscoreFields.expected.client + +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface +import com.netflix.graphql.dgs.codegen.GraphQLProjection +import kotlin.String + +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { + public fun `is`(_alias: String? = null, _projection: IProjection.() -> IProjection): + QueryProjection { + field(_alias, "is", IProjection(inputValueSerializer), _projection) + return this + } +} diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/client/TProjection.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/client/TProjection.kt new file mode 100644 index 000000000..fb1d2a260 --- /dev/null +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/client/TProjection.kt @@ -0,0 +1,20 @@ +package com.netflix.graphql.dgs.codegen.cases.interfaceWithUnderscoreFields.expected.client + +import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface +import com.netflix.graphql.dgs.codegen.GraphQLProjection + +public class TProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { + public val _id: TProjection + get() { + field("_id") + return this + } + + public val id: TProjection + get() { + field("id") + return this + } +} diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/types/I.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/types/I.kt new file mode 100644 index 000000000..684afd187 --- /dev/null +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/types/I.kt @@ -0,0 +1,21 @@ +package com.netflix.graphql.dgs.codegen.cases.interfaceWithUnderscoreFields.expected.types + +import com.fasterxml.jackson.`annotation`.JsonSubTypes +import com.fasterxml.jackson.`annotation`.JsonTypeInfo +import kotlin.String +import kotlin.Suppress +import kotlin.jvm.JvmName + +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "__typename", +) +@JsonSubTypes(value = [ + JsonSubTypes.Type(value = T::class, name = "T") +]) +public sealed interface I { + @Suppress("INAPPLICABLE_JVM_NAME") + @get:JvmName("get_id") + public val _id: String? +} diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/types/Query.kt new file mode 100644 index 000000000..3032086d0 --- /dev/null +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/types/Query.kt @@ -0,0 +1,43 @@ +package com.netflix.graphql.dgs.codegen.cases.interfaceWithUnderscoreFields.expected.types + +import com.fasterxml.jackson.`annotation`.JsonIgnoreProperties +import com.fasterxml.jackson.`annotation`.JsonProperty +import com.fasterxml.jackson.`annotation`.JsonTypeInfo +import com.fasterxml.jackson.databind.`annotation`.JsonDeserialize +import com.fasterxml.jackson.databind.`annotation`.JsonPOJOBuilder +import java.lang.IllegalStateException +import kotlin.collections.List +import kotlin.jvm.JvmName + +@JsonTypeInfo(use = JsonTypeInfo.Id.NONE) +@JsonDeserialize(builder = Query.Builder::class) +public class Query( + `is`: () -> List? = isDefault, +) { + private val __is: () -> List? = `is` + + @get:JvmName("getIs") + public val `is`: List? + get() = __is.invoke() + + public companion object { + private val isDefault: () -> List? = + { throw IllegalStateException("Field `is` was not requested") } + + } + + @JsonPOJOBuilder + @JsonIgnoreProperties("__typename") + public class Builder { + private var `is`: () -> List? = isDefault + + @JsonProperty("is") + public fun withIs(`is`: List?): Builder = this.apply { + this.`is` = { `is` } + } + + public fun build(): Query = Query( + `is` = `is`, + ) + } +} diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/types/T.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/types/T.kt new file mode 100644 index 000000000..a42d09ca4 --- /dev/null +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/expected/types/T.kt @@ -0,0 +1,64 @@ +package com.netflix.graphql.dgs.codegen.cases.interfaceWithUnderscoreFields.expected.types + +import com.fasterxml.jackson.`annotation`.JsonIgnoreProperties +import com.fasterxml.jackson.`annotation`.JsonProperty +import com.fasterxml.jackson.`annotation`.JsonTypeInfo +import com.fasterxml.jackson.databind.`annotation`.JsonDeserialize +import com.fasterxml.jackson.databind.`annotation`.JsonPOJOBuilder +import java.lang.IllegalStateException +import kotlin.String +import kotlin.Suppress +import kotlin.jvm.JvmName + +@JsonTypeInfo(use = JsonTypeInfo.Id.NONE) +@JsonDeserialize(builder = T.Builder::class) +public class T( + _id: () -> String? = _idDefault, + id: () -> String? = idDefault, +) : I { + private val ___id: () -> String? = _id + + private val __id: () -> String? = id + + @Suppress("INAPPLICABLE_JVM_NAME") + @get:JvmName("get_id") + override val _id: String? + get() = ___id.invoke() + + @get:JvmName("getId") + public val id: String? + get() = __id.invoke() + + public companion object { + private val _idDefault: () -> String? = + { throw IllegalStateException("Field `_id` was not requested") } + + + private val idDefault: () -> String? = + { throw IllegalStateException("Field `id` was not requested") } + + } + + @JsonPOJOBuilder + @JsonIgnoreProperties("__typename") + public class Builder { + private var _id: () -> String? = _idDefault + + private var id: () -> String? = idDefault + + @JsonProperty("_id") + public fun with_id(_id: String?): Builder = this.apply { + this._id = { _id } + } + + @JsonProperty("id") + public fun withId(id: String?): Builder = this.apply { + this.id = { id } + } + + public fun build(): T = T( + _id = _id, + id = id, + ) + } +} diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/schema.graphql b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/schema.graphql new file mode 100644 index 000000000..1de3a11fc --- /dev/null +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/interfaceWithUnderscoreFields/schema.graphql @@ -0,0 +1,12 @@ +type Query { + is: [I] +} + +interface I { + _id: ID +} + +type T implements I { + _id: ID + id: ID +} 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/projectionWithEnum/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithEnum/expected/types/Query.kt index 58ee64111..b044f6847 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithEnum/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithEnum/expected/types/Query.kt @@ -15,17 +15,17 @@ public class Query( e: () -> E? = eDefault, es: () -> List? = esDefault, ) { - private val _e: () -> E? = e + private val __e: () -> E? = e - private val _es: () -> List? = es + private val __es: () -> List? = es @get:JvmName("getE") public val e: E? - get() = _e.invoke() + get() = __e.invoke() @get:JvmName("getEs") public val es: List? - get() = _es.invoke() + get() = __es.invoke() public companion object { private val eDefault: () -> 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/projectionWithNestedInputs/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithNestedInputs/expected/types/Query.kt index 531cd0386..2bcafe502 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithNestedInputs/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithNestedInputs/expected/types/Query.kt @@ -15,17 +15,17 @@ public class Query( q1: () -> String? = q1Default, q2: () -> String? = q2Default, ) { - private val _q1: () -> String? = q1 + private val __q1: () -> String? = q1 - private val _q2: () -> String? = q2 + private val __q2: () -> String? = q2 @get:JvmName("getQ1") public val q1: String? - get() = _q1.invoke() + get() = __q1.invoke() @get:JvmName("getQ2") public val q2: String? - get() = _q2.invoke() + get() = __q2.invoke() public companion object { private val q1Default: () -> String? = 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/projectionWithPrimitiveAndArgs/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitiveAndArgs/expected/types/Query.kt index 12f2b1d25..ff6826bee 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitiveAndArgs/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitiveAndArgs/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( string: () -> String? = stringDefault, ) { - private val _string: () -> String? = string + private val __string: () -> String? = string @get:JvmName("getString") public val string: String? - get() = _string.invoke() + get() = __string.invoke() public companion object { private val stringDefault: () -> 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/projectionWithPrimitives/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitives/expected/types/Query.kt index 294d64fb3..8f9cadec4 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitives/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithPrimitives/expected/types/Query.kt @@ -16,17 +16,17 @@ public class Query( string: () -> String? = stringDefault, strings: () -> List? = stringsDefault, ) { - private val _string: () -> String? = string + private val __string: () -> String? = string - private val _strings: () -> List? = strings + private val __strings: () -> List? = strings @get:JvmName("getString") public val string: String? - get() = _string.invoke() + get() = __string.invoke() @get:JvmName("getStrings") public val strings: List? - get() = _strings.invoke() + get() = __strings.invoke() public companion object { private val stringDefault: () -> 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 8eb006615..e1101afae 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,18 +1,21 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun person(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field(_alias, "person", PersonProjection(), _projection) + field(_alias, "person", PersonProjection(inputValueSerializer), _projection) return this } public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection): QueryProjection { - field(_alias, "people", PersonProjection(), _projection) + field(_alias, "people", PersonProjection(inputValueSerializer), _projection) return this } } diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/types/Employee.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/types/Employee.kt index 24a71113b..f35d5adc2 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/types/Employee.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/types/Employee.kt @@ -16,18 +16,18 @@ public class Employee( firstname: () -> String? = firstnameDefault, company: () -> String? = companyDefault, ) : Person { - private val _firstname: () -> String? = firstname + private val __firstname: () -> String? = firstname - private val _company: () -> String? = company + private val __company: () -> String? = company @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getFirstname") override val firstname: String? - get() = _firstname.invoke() + get() = __firstname.invoke() @get:JvmName("getCompany") public val company: String? - get() = _company.invoke() + get() = __company.invoke() public companion object { private val firstnameDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/types/Query.kt index b20ab851c..09acc32f7 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithType/expected/types/Query.kt @@ -15,17 +15,17 @@ public class Query( person: () -> Person? = personDefault, people: () -> List? = peopleDefault, ) { - private val _person: () -> Person? = person + private val __person: () -> Person? = person - private val _people: () -> List? = people + private val __people: () -> List? = people @get:JvmName("getPerson") public val person: Person? - get() = _person.invoke() + get() = __person.invoke() @get:JvmName("getPeople") public val people: List? - get() = _people.invoke() + get() = __people.invoke() public companion object { private val personDefault: () -> Person? = 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 fc927dac6..ad71ba58c 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,10 +1,13 @@ 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( _alias: String? = null, a1: String? = default("a1"), @@ -12,7 +15,8 @@ public class QueryProjection : GraphQLProjection() { a3: I? = default("a3"), _projection: PersonProjection.() -> PersonProjection, ): QueryProjection { - field(_alias, "person", PersonProjection(), _projection, "a1" to a1 , "a2" to a2 , "a3" to a3) + field(_alias, "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/projectionWithTypeAndArgs/expected/types/Employee.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/types/Employee.kt index 7322e2ee8..dd99a2f4d 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/types/Employee.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/types/Employee.kt @@ -16,18 +16,18 @@ public class Employee( firstname: () -> String? = firstnameDefault, company: () -> String? = companyDefault, ) : Person { - private val _firstname: () -> String? = firstname + private val __firstname: () -> String? = firstname - private val _company: () -> String? = company + private val __company: () -> String? = company @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getFirstname") override val firstname: String? - get() = _firstname.invoke() + get() = __firstname.invoke() @get:JvmName("getCompany") public val company: String? - get() = _company.invoke() + get() = __company.invoke() public companion object { private val firstnameDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/types/Query.kt index 5cc92e703..59fc6da2d 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithTypeAndArgs/expected/types/Query.kt @@ -13,11 +13,11 @@ import kotlin.jvm.JvmName public class Query( person: () -> Person? = personDefault, ) { - private val _person: () -> Person? = person + private val __person: () -> Person? = person @get:JvmName("getPerson") public val person: Person? - get() = _person.invoke() + get() = __person.invoke() public companion object { private val personDefault: () -> Person? = 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 160726b71..563b68d05 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,18 +1,21 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun u(_alias: String? = null, _projection: UProjection.() -> UProjection): QueryProjection { - field(_alias, "u", UProjection(), _projection) + field(_alias, "u", UProjection(inputValueSerializer), _projection) return this } public fun us(_alias: String? = null, _projection: UProjection.() -> UProjection): QueryProjection { - field(_alias, "us", UProjection(), _projection) + field(_alias, "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/projectionWithUnion/expected/types/Employee.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/types/Employee.kt index fcf28f010..686629211 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/types/Employee.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/types/Employee.kt @@ -16,18 +16,18 @@ public class Employee( firstname: () -> String? = firstnameDefault, company: () -> String? = companyDefault, ) : Person, U { - private val _firstname: () -> String? = firstname + private val __firstname: () -> String? = firstname - private val _company: () -> String? = company + private val __company: () -> String? = company @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("getFirstname") override val firstname: String? - get() = _firstname.invoke() + get() = __firstname.invoke() @get:JvmName("getCompany") public val company: String? - get() = _company.invoke() + get() = __company.invoke() public companion object { private val firstnameDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/types/Query.kt index 5489e617e..250fe8d99 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/projectionWithUnion/expected/types/Query.kt @@ -15,17 +15,17 @@ public class Query( u: () -> U? = uDefault, us: () -> List? = usDefault, ) { - private val _u: () -> U? = u + private val __u: () -> U? = u - private val _us: () -> List? = us + private val __us: () -> List? = us @get:JvmName("getU") public val u: U? - get() = _u.invoke() + get() = __u.invoke() @get:JvmName("getUs") public val us: List? - get() = _us.invoke() + get() = __us.invoke() public companion object { private val uDefault: () -> U? = 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/skipCodegenOnFields/expected/types/Person.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnFields/expected/types/Person.kt index 777247d2e..d16284f33 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnFields/expected/types/Person.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnFields/expected/types/Person.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Person( name: () -> String? = nameDefault, ) { - private val _name: () -> String? = name + private val __name: () -> String? = name @get:JvmName("getName") public val name: String? - get() = _name.invoke() + get() = __name.invoke() public companion object { private val nameDefault: () -> String? = 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/skipCodegenOnTypes/expected/types/Person.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnTypes/expected/types/Person.kt index 469f38874..419226c53 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnTypes/expected/types/Person.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/skipCodegenOnTypes/expected/types/Person.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Person( name: () -> String? = nameDefault, ) { - private val _name: () -> String? = name + private val __name: () -> String? = name @get:JvmName("getName") public val name: String? - get() = _name.invoke() + get() = __name.invoke() public companion object { private val nameDefault: () -> String? = 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 c51f37059..852f9b315 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun search(_alias: String? = null, _projection: SearchResultProjection.() -> SearchResultProjection): QueryProjection { - field(_alias, "search", SearchResultProjection(), _projection) + field(_alias, "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/union/expected/types/Actor.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/types/Actor.kt index 90a616ea5..5343a07e6 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/types/Actor.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/types/Actor.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Actor( name: () -> String? = nameDefault, ) : SearchResult { - private val _name: () -> String? = name + private val __name: () -> String? = name @get:JvmName("getName") public val name: String? - get() = _name.invoke() + get() = __name.invoke() public companion object { private val nameDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/types/Movie.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/types/Movie.kt index 5b80e1cca..36b56d4af 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/types/Movie.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/types/Movie.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Movie( title: () -> String? = titleDefault, ) : SearchResult { - private val _title: () -> String? = title + private val __title: () -> String? = title @get:JvmName("getTitle") public val title: String? - get() = _title.invoke() + get() = __title.invoke() public companion object { private val titleDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/types/Query.kt index 0e7b3b657..f2865948c 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/union/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( search: () -> List? = searchDefault, ) { - private val _search: () -> List? = search + private val __search: () -> List? = search @get:JvmName("getSearch") public val search: List? - get() = _search.invoke() + get() = __search.invoke() public companion object { private val searchDefault: () -> List? = 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 877d22d98..51296ec79 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,15 +1,19 @@ 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( _alias: String? = null, text: String, _projection: SearchResultPageProjection.() -> SearchResultPageProjection, ): QueryProjection { - field(_alias, "search", SearchResultPageProjection(), _projection, "text" to text) + field(_alias, "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 2dbdfb19c..67b566586 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,13 +1,16 @@ 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 SearchResultPageProjection : GraphQLProjection() { +public class SearchResultPageProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun items(_alias: String? = null, _projection: SearchResultProjection.() -> SearchResultProjection): SearchResultPageProjection { - field(_alias, "items", SearchResultProjection(), _projection) + field(_alias, "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/unionTypesWithoutInterfaceCanDeserialize/expected/types/Droid.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/types/Droid.kt index 8c989e447..78c49bce3 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/types/Droid.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/types/Droid.kt @@ -16,23 +16,23 @@ public class Droid( name: () -> String = nameDefault, primaryFunction: () -> String? = primaryFunctionDefault, ) : SearchResult { - private val _id: () -> String = id + private val __id: () -> String = id - private val _name: () -> String = name + private val __name: () -> String = name - private val _primaryFunction: () -> String? = primaryFunction + private val __primaryFunction: () -> String? = primaryFunction @get:JvmName("getId") public val id: String - get() = _id.invoke() + get() = __id.invoke() @get:JvmName("getName") public val name: String - get() = _name.invoke() + get() = __name.invoke() @get:JvmName("getPrimaryFunction") public val primaryFunction: String? - get() = _primaryFunction.invoke() + get() = __primaryFunction.invoke() public companion object { private val idDefault: () -> String = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/types/Human.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/types/Human.kt index 109de5d8d..560eb4f5c 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/types/Human.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/types/Human.kt @@ -17,23 +17,23 @@ public class Human( name: () -> String = nameDefault, totalCredits: () -> Int? = totalCreditsDefault, ) : SearchResult { - private val _id: () -> String = id + private val __id: () -> String = id - private val _name: () -> String = name + private val __name: () -> String = name - private val _totalCredits: () -> Int? = totalCredits + private val __totalCredits: () -> Int? = totalCredits @get:JvmName("getId") public val id: String - get() = _id.invoke() + get() = __id.invoke() @get:JvmName("getName") public val name: String - get() = _name.invoke() + get() = __name.invoke() @get:JvmName("getTotalCredits") public val totalCredits: Int? - get() = _totalCredits.invoke() + get() = __totalCredits.invoke() public companion object { private val idDefault: () -> String = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/types/Query.kt index 4531bb092..dc867a0b2 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/types/Query.kt @@ -13,11 +13,11 @@ import kotlin.jvm.JvmName public class Query( search: () -> SearchResultPage? = searchDefault, ) { - private val _search: () -> SearchResultPage? = search + private val __search: () -> SearchResultPage? = search @get:JvmName("getSearch") public val search: SearchResultPage? - get() = _search.invoke() + get() = __search.invoke() public companion object { private val searchDefault: () -> SearchResultPage? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/types/SearchResultPage.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/types/SearchResultPage.kt index 460cff0e5..590d752a8 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/types/SearchResultPage.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionTypesWithoutInterfaceCanDeserialize/expected/types/SearchResultPage.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class SearchResultPage( items: () -> List? = itemsDefault, ) { - private val _items: () -> List? = items + private val __items: () -> List? = items @get:JvmName("getItems") public val items: List? - get() = _items.invoke() + get() = __items.invoke() public companion object { private val itemsDefault: () -> List? = 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 7f05dca30..fc7118c58 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,12 +1,15 @@ 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 import kotlin.String -public class QueryProjection : GraphQLProjection() { +public class QueryProjection( + inputValueSerializer: InputValueSerializerInterface? = null, +) : GraphQLProjection(inputValueSerializer) { public fun search(_alias: String? = null, _projection: SearchResultProjection.() -> SearchResultProjection): QueryProjection { - field(_alias, "search", SearchResultProjection(), _projection) + field(_alias, "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/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/types/Actor.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/types/Actor.kt index 1c6590f5c..2bd6de47c 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/types/Actor.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/types/Actor.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Actor( name: () -> String? = nameDefault, ) : SearchResult { - private val _name: () -> String? = name + private val __name: () -> String? = name @get:JvmName("getName") public val name: String? - get() = _name.invoke() + get() = __name.invoke() public companion object { private val nameDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/types/Movie.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/types/Movie.kt index cd100e0f4..9ec8770e8 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/types/Movie.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/types/Movie.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Movie( title: () -> String? = titleDefault, ) : SearchResult { - private val _title: () -> String? = title + private val __title: () -> String? = title @get:JvmName("getTitle") public val title: String? - get() = _title.invoke() + get() = __title.invoke() public companion object { private val titleDefault: () -> String? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/types/Query.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/types/Query.kt index 80200673f..429cad805 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/types/Query.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/types/Query.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Query( search: () -> List? = searchDefault, ) { - private val _search: () -> List? = search + private val __search: () -> List? = search @get:JvmName("getSearch") public val search: List? - get() = _search.invoke() + get() = __search.invoke() public companion object { private val searchDefault: () -> List? = diff --git a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/types/Rating.kt b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/types/Rating.kt index 1d75464ec..718443991 100644 --- a/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/types/Rating.kt +++ b/graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/unionWithExtendedType/expected/types/Rating.kt @@ -14,11 +14,11 @@ import kotlin.jvm.JvmName public class Rating( stars: () -> Int? = starsDefault, ) : SearchResult { - private val _stars: () -> Int? = stars + private val __stars: () -> Int? = stars @get:JvmName("getStars") public val stars: Int? - get() = _stars.invoke() + get() = __stars.invoke() public companion object { private val starsDefault: () -> Int? = 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 4f77a0606..c4b2d5e55 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)) @@ -120,7 +126,7 @@ fun generateKotlin2ClientTypes( .addParameter(projection) .returns(typeName) .addStatement( - """field(_alias, %S, %T(), _projection%L)""", + """field(_alias, %S, %T(inputValueSerializer), _projection%L)""", field.name, projectionType, field.inputValueDefinitions.joinToString(" ") { """, "${it.name}" to ${it.name}""" } @@ -138,7 +144,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") { @@ -171,7 +179,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) @@ -194,10 +204,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-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin2/GenerateKotlin2DataTypes.kt b/graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin2/GenerateKotlin2DataTypes.kt index 9fc33e406..695740a4a 100644 --- a/graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin2/GenerateKotlin2DataTypes.kt +++ b/graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin2/GenerateKotlin2DataTypes.kt @@ -213,7 +213,7 @@ fun generateKotlin2DataTypes( .addProperties( fields.map { field -> PropertySpec.builder( - name = "_${field.name}", + name = "__${field.name}", type = LambdaTypeName.get(returnType = type(field)) ) .addModifiers(KModifier.PRIVATE) @@ -242,7 +242,7 @@ fun generateKotlin2DataTypes( .addAnnotation(jvmNameAnnotation(field.name)) .getter( FunSpec.getterBuilder() - .addStatement("return _${field.name}.invoke()") + .addStatement("return __${field.name}.invoke()") .build() ) .build() 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 ae67e0382..6c27f9bad 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 @@ -51,11 +52,14 @@ object DefaultTracker { } @QueryProjectionMarker -abstract class GraphQLProjection(defaultFields: Set = setOf("__typename")) { +abstract class GraphQLProjection( + protected val inputValueSerializer: InputValueSerializerInterface? = null, + defaultFields: Set = setOf("__typename") +) { companion object { - private val inputSerializer = InputValueSerializer() + val defaultInputValueSerializer = InputValueSerializer() @JvmStatic protected fun default0(arg: String): T? { @@ -105,7 +109,7 @@ abstract class GraphQLProjection(defaultFields: Set = setOf("__typename" .map { (arg, value) -> Argument.newArgument() .name(arg) - .value(inputSerializer.toValue(value)) + .value((inputValueSerializer ?: defaultInputValueSerializer).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 {