Skip to content

Commit 8a6f6cf

Browse files
authored
Merge pull request #676 from Netflix/feature/kotlin2-aliases
Add support for aliases in kotlin2 queries
2 parents a5d4919 + f00d03c commit 8a6f6cf

File tree

54 files changed

+298
-192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+298
-192
lines changed

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsForInputTypes/expected/client/QueryProjection.kt

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ package com.netflix.graphql.dgs.codegen.cases.constantsForInputTypes.expected.cl
33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
55
import com.netflix.graphql.dgs.codegen.cases.constantsForInputTypes.expected.types.PersonFilter
6+
import kotlin.String
67

78
public class QueryProjection(
89
inputValueSerializer: InputValueSerializerInterface? = null,
910
) : GraphQLProjection(inputValueSerializer) {
10-
public fun people(filter: PersonFilter? = default<QueryProjection, PersonFilter?>("filter"),
11-
_projection: PersonProjection.() -> PersonProjection): QueryProjection {
12-
field("people", PersonProjection(inputValueSerializer), _projection, "filter" to filter)
11+
public fun people(
12+
_alias: String? = null,
13+
filter: PersonFilter? = default<QueryProjection, PersonFilter?>("filter"),
14+
_projection: PersonProjection.() -> PersonProjection,
15+
): QueryProjection {
16+
field(_alias, "people", PersonProjection(inputValueSerializer), _projection, "filter" to filter)
1317
return this
1418
}
1519
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInputTypes/expected/client/QueryProjection.kt

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ package com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedInputTypes.ex
33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
55
import com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedInputTypes.expected.types.PersonFilter
6+
import kotlin.String
67

78
public class QueryProjection(
89
inputValueSerializer: InputValueSerializerInterface? = null,
910
) : GraphQLProjection(inputValueSerializer) {
10-
public fun people(filter: PersonFilter? = default<QueryProjection, PersonFilter?>("filter"),
11-
_projection: PersonProjection.() -> PersonProjection): QueryProjection {
12-
field("people", PersonProjection(inputValueSerializer), _projection, "filter" to filter)
11+
public fun people(
12+
_alias: String? = null,
13+
filter: PersonFilter? = default<QueryProjection, PersonFilter?>("filter"),
14+
_projection: PersonProjection.() -> PersonProjection,
15+
): QueryProjection {
16+
field(_alias, "people", PersonProjection(inputValueSerializer), _projection, "filter" to filter)
1317
return this
1418
}
1519
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedInterface/expected/client/QueryProjection.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ package com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedInterface.exp
22

33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
5+
import kotlin.String
56

67
public class QueryProjection(
78
inputValueSerializer: InputValueSerializerInterface? = null,
89
) : GraphQLProjection(inputValueSerializer) {
9-
public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection {
10-
field("people", PersonProjection(inputValueSerializer), _projection)
10+
public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection):
11+
QueryProjection {
12+
field(_alias, "people", PersonProjection(inputValueSerializer), _projection)
1113
return this
1214
}
1315
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedQuery/expected/client/QueryProjection.kt

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@ package com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedQuery.expecte
22

33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
5+
import kotlin.String
56

67
public class QueryProjection(
78
inputValueSerializer: InputValueSerializerInterface? = null,
89
) : GraphQLProjection(inputValueSerializer) {
9-
public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection {
10-
field("people", PersonProjection(inputValueSerializer), _projection)
10+
public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection):
11+
QueryProjection {
12+
field(_alias, "people", PersonProjection(inputValueSerializer), _projection)
1113
return this
1214
}
1315

14-
public fun friends(_projection: PersonProjection.() -> PersonProjection): QueryProjection {
15-
field("friends", PersonProjection(inputValueSerializer), _projection)
16+
public fun friends(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection):
17+
QueryProjection {
18+
field(_alias, "friends", PersonProjection(inputValueSerializer), _projection)
1619
return this
1720
}
1821
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/constantsWithExtendedTypes/expected/client/QueryProjection.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ package com.netflix.graphql.dgs.codegen.cases.constantsWithExtendedTypes.expecte
22

33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
5+
import kotlin.String
56

67
public class QueryProjection(
78
inputValueSerializer: InputValueSerializerInterface? = null,
89
) : GraphQLProjection(inputValueSerializer) {
9-
public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection {
10-
field("people", PersonProjection(inputValueSerializer), _projection)
10+
public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection):
11+
QueryProjection {
12+
field(_alias, "people", PersonProjection(inputValueSerializer), _projection)
1113
return this
1214
}
1315
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassDocs/expected/client/QueryProjection.kt

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassDocs.expected.client
33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
55
import com.netflix.graphql.dgs.codegen.cases.dataClassDocs.expected.types.MovieFilter
6+
import kotlin.String
67

78
public class QueryProjection(
89
inputValueSerializer: InputValueSerializerInterface? = null,
910
) : GraphQLProjection(inputValueSerializer) {
10-
public fun search(movieFilter: MovieFilter, _projection: MovieProjection.() -> MovieProjection):
11-
QueryProjection {
12-
field("search", MovieProjection(inputValueSerializer), _projection, "movieFilter" to
11+
public fun search(
12+
_alias: String? = null,
13+
movieFilter: MovieFilter,
14+
_projection: MovieProjection.() -> MovieProjection,
15+
): QueryProjection {
16+
field(_alias, "search", MovieProjection(inputValueSerializer), _projection, "movieFilter" to
1317
movieFilter)
1418
return this
1519
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassFieldDocs/expected/client/QueryProjection.kt

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassFieldDocs.expected.client
33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
55
import com.netflix.graphql.dgs.codegen.cases.dataClassFieldDocs.expected.types.MovieFilter
6+
import kotlin.String
67

78
public class QueryProjection(
89
inputValueSerializer: InputValueSerializerInterface? = null,
910
) : GraphQLProjection(inputValueSerializer) {
10-
public fun search(movieFilter: MovieFilter, _projection: MovieProjection.() -> MovieProjection):
11-
QueryProjection {
12-
field("search", MovieProjection(inputValueSerializer), _projection, "movieFilter" to
11+
public fun search(
12+
_alias: String? = null,
13+
movieFilter: MovieFilter,
14+
_projection: MovieProjection.() -> MovieProjection,
15+
): QueryProjection {
16+
field(_alias, "search", MovieProjection(inputValueSerializer), _projection, "movieFilter" to
1317
movieFilter)
1418
return this
1519
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWIthNoFields/expected/client/QueryProjection.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWIthNoFields.expected.cli
22

33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
5+
import kotlin.String
56

67
public class QueryProjection(
78
inputValueSerializer: InputValueSerializerInterface? = null,
89
) : GraphQLProjection(inputValueSerializer) {
9-
public fun me(_projection: PersonProjection.() -> PersonProjection): QueryProjection {
10-
field("me", PersonProjection(inputValueSerializer), _projection)
10+
public fun me(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection):
11+
QueryProjection {
12+
field(_alias, "me", PersonProjection(inputValueSerializer), _projection)
1113
return this
1214
}
1315
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/client/QueryProjection.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithBooleanField.expected
22

33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
5+
import kotlin.String
56

67
public class QueryProjection(
78
inputValueSerializer: InputValueSerializerInterface? = null,
89
) : GraphQLProjection(inputValueSerializer) {
9-
public fun test(_projection: RequiredTestTypeProjection.() -> RequiredTestTypeProjection):
10-
QueryProjection {
11-
field("test", RequiredTestTypeProjection(inputValueSerializer), _projection)
10+
public fun test(_alias: String? = null,
11+
_projection: RequiredTestTypeProjection.() -> RequiredTestTypeProjection): QueryProjection {
12+
field(_alias, "test", RequiredTestTypeProjection(inputValueSerializer), _projection)
1213
return this
1314
}
1415
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/EntityConnectionProjection.kt

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithDeclaredScalars.expec
22

33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
5+
import kotlin.String
56

67
public class EntityConnectionProjection(
78
inputValueSerializer: InputValueSerializerInterface? = null,
89
) : GraphQLProjection(inputValueSerializer) {
9-
public fun pageInfo(_projection: PageInfoProjection.() -> PageInfoProjection):
10-
EntityConnectionProjection {
11-
field("pageInfo", PageInfoProjection(inputValueSerializer), _projection)
10+
public fun pageInfo(_alias: String? = null,
11+
_projection: PageInfoProjection.() -> PageInfoProjection): EntityConnectionProjection {
12+
field(_alias, "pageInfo", PageInfoProjection(inputValueSerializer), _projection)
1213
return this
1314
}
1415

15-
public fun edges(_projection: EntityEdgeProjection.() -> EntityEdgeProjection):
16-
EntityConnectionProjection {
17-
field("edges", EntityEdgeProjection(inputValueSerializer), _projection)
16+
public fun edges(_alias: String? = null,
17+
_projection: EntityEdgeProjection.() -> EntityEdgeProjection): EntityConnectionProjection {
18+
field(_alias, "edges", EntityEdgeProjection(inputValueSerializer), _projection)
1819
return this
1920
}
2021
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/EntityEdgeProjection.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithDeclaredScalars.expec
22

33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
5+
import kotlin.String
56

67
public class EntityEdgeProjection(
78
inputValueSerializer: InputValueSerializerInterface? = null,
@@ -12,8 +13,9 @@ public class EntityEdgeProjection(
1213
return this
1314
}
1415

15-
public fun node(_projection: EntityProjection.() -> EntityProjection): EntityEdgeProjection {
16-
field("node", EntityProjection(inputValueSerializer), _projection)
16+
public fun node(_alias: String? = null, _projection: EntityProjection.() -> EntityProjection):
17+
EntityEdgeProjection {
18+
field(_alias, "node", EntityProjection(inputValueSerializer), _projection)
1719
return this
1820
}
1921
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeclaredScalars/expected/client/QueryProjection.kt

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithDeclaredScalars.expec
22

33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
5+
import kotlin.String
56

67
public class QueryProjection(
78
inputValueSerializer: InputValueSerializerInterface? = null,
89
) : GraphQLProjection(inputValueSerializer) {
9-
public fun entity(_projection: EntityProjection.() -> EntityProjection): QueryProjection {
10-
field("entity", EntityProjection(inputValueSerializer), _projection)
10+
public fun entity(_alias: String? = null, _projection: EntityProjection.() -> EntityProjection):
11+
QueryProjection {
12+
field(_alias, "entity", EntityProjection(inputValueSerializer), _projection)
1113
return this
1214
}
1315

14-
public
15-
fun entityConnection(_projection: EntityConnectionProjection.() -> EntityConnectionProjection):
16-
QueryProjection {
17-
field("entityConnection", EntityConnectionProjection(inputValueSerializer), _projection)
16+
public fun entityConnection(_alias: String? = null,
17+
_projection: EntityConnectionProjection.() -> EntityConnectionProjection): QueryProjection {
18+
field(_alias, "entityConnection", EntityConnectionProjection(inputValueSerializer), _projection)
1819
return this
1920
}
2021
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/CarProjection.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithDeeplyNestedComplexFi
22

33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
5+
import kotlin.String
56

67
public class CarProjection(
78
inputValueSerializer: InputValueSerializerInterface? = null,
@@ -18,8 +19,9 @@ public class CarProjection(
1819
return this
1920
}
2021

21-
public fun engine(_projection: EngineProjection.() -> EngineProjection): CarProjection {
22-
field("engine", EngineProjection(inputValueSerializer), _projection)
22+
public fun engine(_alias: String? = null, _projection: EngineProjection.() -> EngineProjection):
23+
CarProjection {
24+
field(_alias, "engine", EngineProjection(inputValueSerializer), _projection)
2325
return this
2426
}
2527
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/EngineProjection.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithDeeplyNestedComplexFi
22

33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
5+
import kotlin.String
56

67
public class EngineProjection(
78
inputValueSerializer: InputValueSerializerInterface? = null,
@@ -24,9 +25,9 @@ public class EngineProjection(
2425
return this
2526
}
2627

27-
public fun performance(_projection: PerformanceProjection.() -> PerformanceProjection):
28-
EngineProjection {
29-
field("performance", PerformanceProjection(inputValueSerializer), _projection)
28+
public fun performance(_alias: String? = null,
29+
_projection: PerformanceProjection.() -> PerformanceProjection): EngineProjection {
30+
field(_alias, "performance", PerformanceProjection(inputValueSerializer), _projection)
3031
return this
3132
}
3233
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithDeeplyNestedComplexField/expected/client/QueryProjection.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithDeeplyNestedComplexFi
22

33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
5+
import kotlin.String
56

67
public class QueryProjection(
78
inputValueSerializer: InputValueSerializerInterface? = null,
89
) : GraphQLProjection(inputValueSerializer) {
9-
public fun cars(_projection: CarProjection.() -> CarProjection): QueryProjection {
10-
field("cars", CarProjection(inputValueSerializer), _projection)
10+
public fun cars(_alias: String? = null, _projection: CarProjection.() -> CarProjection):
11+
QueryProjection {
12+
field(_alias, "cars", CarProjection(inputValueSerializer), _projection)
1113
return this
1214
}
1315
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithExtendedInterface/expected/client/QueryProjection.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithExtendedInterface.exp
22

33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
5+
import kotlin.String
56

67
public class QueryProjection(
78
inputValueSerializer: InputValueSerializerInterface? = null,
89
) : GraphQLProjection(inputValueSerializer) {
9-
public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection {
10-
field("people", PersonProjection(inputValueSerializer), _projection)
10+
public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection):
11+
QueryProjection {
12+
field(_alias, "people", PersonProjection(inputValueSerializer), _projection)
1113
return this
1214
}
1315
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterface/expected/client/QueryProjection.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithInterface.expected.cl
22

33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
5+
import kotlin.String
56

67
public class QueryProjection(
78
inputValueSerializer: InputValueSerializerInterface? = null,
89
) : GraphQLProjection(inputValueSerializer) {
9-
public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection {
10-
field("people", PersonProjection(inputValueSerializer), _projection)
10+
public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection):
11+
QueryProjection {
12+
field(_alias, "people", PersonProjection(inputValueSerializer), _projection)
1113
return this
1214
}
1315
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithInterfaceInheritance/expected/client/QueryProjection.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithInterfaceInheritance.
22

33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
5+
import kotlin.String
56

67
public class QueryProjection(
78
inputValueSerializer: InputValueSerializerInterface? = null,
89
) : GraphQLProjection(inputValueSerializer) {
9-
public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection {
10-
field("people", PersonProjection(inputValueSerializer), _projection)
10+
public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection):
11+
QueryProjection {
12+
field(_alias, "people", PersonProjection(inputValueSerializer), _projection)
1113
return this
1214
}
1315
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithListProperties/expected/client/QueryProjection.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithListProperties.expect
22

33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
5+
import kotlin.String
56

67
public class QueryProjection(
78
inputValueSerializer: InputValueSerializerInterface? = null,
89
) : GraphQLProjection(inputValueSerializer) {
9-
public fun people(_projection: PersonProjection.() -> PersonProjection): QueryProjection {
10-
field("people", PersonProjection(inputValueSerializer), _projection)
10+
public fun people(_alias: String? = null, _projection: PersonProjection.() -> PersonProjection):
11+
QueryProjection {
12+
field(_alias, "people", PersonProjection(inputValueSerializer), _projection)
1113
return this
1214
}
1315
}

graphql-dgs-codegen-core/src/integTest/kotlin/com/netflix/graphql/dgs/codegen/cases/dataClassWithMappedInterfaces/expected/client/QueryProjection.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ package com.netflix.graphql.dgs.codegen.cases.dataClassWithMappedInterfaces.expe
22

33
import com.netflix.graphql.dgs.client.codegen.InputValueSerializerInterface
44
import com.netflix.graphql.dgs.codegen.GraphQLProjection
5+
import kotlin.String
56

67
public class QueryProjection(
78
inputValueSerializer: InputValueSerializerInterface? = null,
89
) : GraphQLProjection(inputValueSerializer) {
9-
public fun products(_projection: ProductProjection.() -> ProductProjection): QueryProjection {
10-
field("products", ProductProjection(inputValueSerializer), _projection)
10+
public fun products(_alias: String? = null,
11+
_projection: ProductProjection.() -> ProductProjection): QueryProjection {
12+
field(_alias, "products", ProductProjection(inputValueSerializer), _projection)
1113
return this
1214
}
1315
}

0 commit comments

Comments
 (0)