Skip to content

Commit bc85f0b

Browse files
authored
update to latest version of kotlinpoet (ExpediaGroup#1092)
Starting with version `1.7.0` kotlinpoet now generates code in explicit API mode
1 parent 1747189 commit bc85f0b

File tree

109 files changed

+688
-682
lines changed

Some content is hidden

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

109 files changed

+688
-682
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ classGraphVersion = 4.8.103
2323
federationGraphQLVersion = 0.6.3
2424
graphQLJavaVersion = 16.2
2525
jacksonVersion = 2.11.4
26-
kotlinPoetVersion = 1.6.0
26+
kotlinPoetVersion = 1.7.2
2727
ktorVersion = 1.5.2
2828
reactorVersion = 3.4.4
2929
reactorExtensionsVersion = 1.1.3

plugins/client/graphql-kotlin-client-generator/src/test/data/generator/alias/AliasQuery.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ import kotlin.Boolean
55
import kotlin.String
66
import kotlin.reflect.KClass
77

8-
const val ALIAS_QUERY: String =
8+
public const val ALIAS_QUERY: String =
99
"query AliasQuery {\n first: inputObjectQuery(criteria: { min: 1.0, max: 5.0 } )\n second: inputObjectQuery(criteria: { min: 5.0, max: 10.0 } )\n}"
1010

11-
class AliasQuery : GraphQLClientRequest<AliasQuery.Result> {
12-
override val query: String = ALIAS_QUERY
11+
public class AliasQuery : GraphQLClientRequest<AliasQuery.Result> {
12+
public override val query: String = ALIAS_QUERY
1313

14-
override val operationName: String = "AliasQuery"
14+
public override val operationName: String = "AliasQuery"
1515

16-
override fun responseType(): KClass<AliasQuery.Result> = AliasQuery.Result::class
16+
public override fun responseType(): KClass<AliasQuery.Result> = AliasQuery.Result::class
1717

18-
data class Result(
18+
public data class Result(
1919
/**
2020
* Query that accepts some input arguments
2121
*/
22-
val first: Boolean,
22+
public val first: Boolean,
2323
/**
2424
* Query that accepts some input arguments
2525
*/
26-
val second: Boolean
26+
public val second: Boolean
2727
)
2828
}

plugins/client/graphql-kotlin-client-generator/src/test/data/generator/documentation/DocumentationQuery.kt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@ import com.expediagroup.graphql.generated.documentationquery.DocObject
55
import kotlin.String
66
import kotlin.reflect.KClass
77

8-
const val DOCUMENTATION_QUERY: String = "query DocumentationQuery {\n docQuery {\n id\n }\n}"
8+
public const val DOCUMENTATION_QUERY: String =
9+
"query DocumentationQuery {\n docQuery {\n id\n }\n}"
910

10-
class DocumentationQuery : GraphQLClientRequest<DocumentationQuery.Result> {
11-
override val query: String = DOCUMENTATION_QUERY
11+
public class DocumentationQuery : GraphQLClientRequest<DocumentationQuery.Result> {
12+
public override val query: String = DOCUMENTATION_QUERY
1213

13-
override val operationName: String = "DocumentationQuery"
14+
public override val operationName: String = "DocumentationQuery"
1415

15-
override fun responseType(): KClass<DocumentationQuery.Result> = DocumentationQuery.Result::class
16+
public override fun responseType(): KClass<DocumentationQuery.Result> =
17+
DocumentationQuery.Result::class
1618

17-
data class Result(
19+
public data class Result(
1820
/**
1921
* Query to test doc strings
2022
*/
21-
val docQuery: DocObject
23+
public val docQuery: DocObject
2224
)
2325
}

plugins/client/graphql-kotlin-client-generator/src/test/data/generator/documentation/documentationquery/DocObject.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import kotlin.Int
55
/**
66
* Doc object with % and $ floating around
77
*/
8-
data class DocObject(
8+
public data class DocObject(
99
/**
1010
* An id with a comment containing % and $ as well
1111
*/
12-
val id: Int
12+
public val id: Int
1313
)

plugins/client/graphql-kotlin-client-generator/src/test/data/generator/input_hard_coded/HardCodedInputQuery.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ import kotlin.Boolean
55
import kotlin.String
66
import kotlin.reflect.KClass
77

8-
const val HARD_CODED_INPUT_QUERY: String =
8+
public const val HARD_CODED_INPUT_QUERY: String =
99
"query HardCodedInputQuery {\n inputObjectQuery(criteria: { min: 1.0, max: 5.0 } )\n}"
1010

11-
class HardCodedInputQuery : GraphQLClientRequest<HardCodedInputQuery.Result> {
12-
override val query: String = HARD_CODED_INPUT_QUERY
11+
public class HardCodedInputQuery : GraphQLClientRequest<HardCodedInputQuery.Result> {
12+
public override val query: String = HARD_CODED_INPUT_QUERY
1313

14-
override val operationName: String = "HardCodedInputQuery"
14+
public override val operationName: String = "HardCodedInputQuery"
1515

16-
override fun responseType(): KClass<HardCodedInputQuery.Result> =
16+
public override fun responseType(): KClass<HardCodedInputQuery.Result> =
1717
HardCodedInputQuery.Result::class
1818

19-
data class Result(
19+
public data class Result(
2020
/**
2121
* Query that accepts some input arguments
2222
*/
23-
val inputObjectQuery: Boolean
23+
public val inputObjectQuery: Boolean
2424
)
2525
}

plugins/client/graphql-kotlin-client-generator/src/test/data/generator/input_self_reference/SelfReferencingInputQuery.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@ import kotlin.Boolean
66
import kotlin.String
77
import kotlin.reflect.KClass
88

9-
const val SELF_REFERENCING_INPUT_QUERY: String =
9+
public const val SELF_REFERENCING_INPUT_QUERY: String =
1010
"query SelfReferencingInputQuery(${'$'}input: ComplexArgumentInput) {\n complexInputObjectQuery(criteria: ${'$'}input)\n}"
1111

12-
class SelfReferencingInputQuery(
13-
override val variables: SelfReferencingInputQuery.Variables
12+
public class SelfReferencingInputQuery(
13+
public override val variables: SelfReferencingInputQuery.Variables
1414
) : GraphQLClientRequest<SelfReferencingInputQuery.Result> {
15-
override val query: String = SELF_REFERENCING_INPUT_QUERY
15+
public override val query: String = SELF_REFERENCING_INPUT_QUERY
1616

17-
override val operationName: String = "SelfReferencingInputQuery"
17+
public override val operationName: String = "SelfReferencingInputQuery"
1818

19-
override fun responseType(): KClass<SelfReferencingInputQuery.Result> =
19+
public override fun responseType(): KClass<SelfReferencingInputQuery.Result> =
2020
SelfReferencingInputQuery.Result::class
2121

22-
data class Variables(
23-
val input: ComplexArgumentInput? = null
22+
public data class Variables(
23+
public val input: ComplexArgumentInput? = null
2424
)
2525

26-
data class Result(
26+
public data class Result(
2727
/**
2828
* Query that accepts self referencing input object
2929
*/
30-
val complexInputObjectQuery: Boolean
30+
public val complexInputObjectQuery: Boolean
3131
)
3232
}

plugins/client/graphql-kotlin-client-generator/src/test/data/generator/input_self_reference/inputs/ComplexArgumentInput.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ import kotlin.Float
55
/**
66
* Self referencing input object
77
*/
8-
data class ComplexArgumentInput(
8+
public data class ComplexArgumentInput(
99
/**
1010
* Maximum value for test criteria
1111
*/
12-
val max: Float? = null,
12+
public val max: Float? = null,
1313
/**
1414
* Minimum value for test criteria
1515
*/
16-
val min: Float? = null,
16+
public val min: Float? = null,
1717
/**
1818
* Next criteria
1919
*/
20-
val next: ComplexArgumentInput? = null
20+
public val next: ComplexArgumentInput? = null
2121
)

plugins/client/graphql-kotlin-client-generator/src/test/data/generator/interface_diff_selection_sets/DifferentSelectionSetQuery.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ import com.expediagroup.graphql.generated.differentselectionsetquery.BasicInterf
66
import kotlin.String
77
import kotlin.reflect.KClass
88

9-
const val DIFFERENT_SELECTION_SET_QUERY: String =
9+
public const val DIFFERENT_SELECTION_SET_QUERY: String =
1010
"query DifferentSelectionSetQuery {\n first: interfaceQuery {\n __typename\n id\n name\n ... on FirstInterfaceImplementation {\n intValue\n }\n ... on SecondInterfaceImplementation {\n floatValue\n }\n }\n second: interfaceQuery {\n __typename\n name\n ... on FirstInterfaceImplementation {\n intValue\n }\n ... on SecondInterfaceImplementation {\n floatValue\n }\n }\n}"
1111

12-
class DifferentSelectionSetQuery : GraphQLClientRequest<DifferentSelectionSetQuery.Result> {
13-
override val query: String = DIFFERENT_SELECTION_SET_QUERY
12+
public class DifferentSelectionSetQuery : GraphQLClientRequest<DifferentSelectionSetQuery.Result> {
13+
public override val query: String = DIFFERENT_SELECTION_SET_QUERY
1414

15-
override val operationName: String = "DifferentSelectionSetQuery"
15+
public override val operationName: String = "DifferentSelectionSetQuery"
1616

17-
override fun responseType(): KClass<DifferentSelectionSetQuery.Result> =
17+
public override fun responseType(): KClass<DifferentSelectionSetQuery.Result> =
1818
DifferentSelectionSetQuery.Result::class
1919

20-
data class Result(
20+
public data class Result(
2121
/**
2222
* Query returning an interface
2323
*/
24-
val first: BasicInterface,
24+
public val first: BasicInterface,
2525
/**
2626
* Query returning an interface
2727
*/
28-
val second: BasicInterface2
28+
public val second: BasicInterface2
2929
)
3030
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.expediagroup.graphql.generated.differentselectionsetquery
22

3-
import com.fasterxml.jackson.annotation.JsonSubTypes
4-
import com.fasterxml.jackson.annotation.JsonTypeInfo
5-
import com.fasterxml.jackson.annotation.JsonTypeInfo.As.PROPERTY
6-
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME
3+
import com.fasterxml.jackson.`annotation`.JsonSubTypes
4+
import com.fasterxml.jackson.`annotation`.JsonTypeInfo
5+
import com.fasterxml.jackson.`annotation`.JsonTypeInfo.As.PROPERTY
6+
import com.fasterxml.jackson.`annotation`.JsonTypeInfo.Id.NAME
77
import kotlin.Float
88
import kotlin.Int
99
import kotlin.String
@@ -20,50 +20,50 @@ import kotlin.String
2020
FirstInterfaceImplementation::class,
2121
name="FirstInterfaceImplementation"),com.fasterxml.jackson.annotation.JsonSubTypes.Type(value =
2222
SecondInterfaceImplementation::class, name="SecondInterfaceImplementation")])
23-
interface BasicInterface {
23+
public interface BasicInterface {
2424
/**
2525
* Unique identifier of an interface
2626
*/
27-
abstract val id: Int
27+
public abstract val id: Int
2828

2929
/**
3030
* Name field
3131
*/
32-
abstract val name: String
32+
public abstract val name: String
3333
}
3434

3535
/**
3636
* Example interface implementation where value is an integer
3737
*/
38-
data class FirstInterfaceImplementation(
38+
public data class FirstInterfaceImplementation(
3939
/**
4040
* Unique identifier of the first implementation
4141
*/
42-
override val id: Int,
42+
public override val id: Int,
4343
/**
4444
* Name of the first implementation
4545
*/
46-
override val name: String,
46+
public override val name: String,
4747
/**
4848
* Custom field integer value
4949
*/
50-
val intValue: Int
50+
public val intValue: Int
5151
) : BasicInterface
5252

5353
/**
5454
* Example interface implementation where value is a float
5555
*/
56-
data class SecondInterfaceImplementation(
56+
public data class SecondInterfaceImplementation(
5757
/**
5858
* Unique identifier of the second implementation
5959
*/
60-
override val id: Int,
60+
public override val id: Int,
6161
/**
6262
* Name of the second implementation
6363
*/
64-
override val name: String,
64+
public override val name: String,
6565
/**
6666
* Custom field float value
6767
*/
68-
val floatValue: Float
68+
public val floatValue: Float
6969
) : BasicInterface
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.expediagroup.graphql.generated.differentselectionsetquery
22

3-
import com.fasterxml.jackson.annotation.JsonSubTypes
4-
import com.fasterxml.jackson.annotation.JsonTypeInfo
5-
import com.fasterxml.jackson.annotation.JsonTypeInfo.As.PROPERTY
6-
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME
3+
import com.fasterxml.jackson.`annotation`.JsonSubTypes
4+
import com.fasterxml.jackson.`annotation`.JsonTypeInfo
5+
import com.fasterxml.jackson.`annotation`.JsonTypeInfo.As.PROPERTY
6+
import com.fasterxml.jackson.`annotation`.JsonTypeInfo.Id.NAME
77
import kotlin.Float
88
import kotlin.Int
99
import kotlin.String
@@ -20,37 +20,37 @@ import kotlin.String
2020
FirstInterfaceImplementation2::class,
2121
name="FirstInterfaceImplementation"),com.fasterxml.jackson.annotation.JsonSubTypes.Type(value =
2222
SecondInterfaceImplementation2::class, name="SecondInterfaceImplementation")])
23-
interface BasicInterface2 {
23+
public interface BasicInterface2 {
2424
/**
2525
* Name field
2626
*/
27-
abstract val name: String
27+
public abstract val name: String
2828
}
2929

3030
/**
3131
* Example interface implementation where value is an integer
3232
*/
33-
data class FirstInterfaceImplementation2(
33+
public data class FirstInterfaceImplementation2(
3434
/**
3535
* Name of the first implementation
3636
*/
37-
override val name: String,
37+
public override val name: String,
3838
/**
3939
* Custom field integer value
4040
*/
41-
val intValue: Int
41+
public val intValue: Int
4242
) : BasicInterface2
4343

4444
/**
4545
* Example interface implementation where value is a float
4646
*/
47-
data class SecondInterfaceImplementation2(
47+
public data class SecondInterfaceImplementation2(
4848
/**
4949
* Name of the second implementation
5050
*/
51-
override val name: String,
51+
public override val name: String,
5252
/**
5353
* Custom field float value
5454
*/
55-
val floatValue: Float
55+
public val floatValue: Float
5656
) : BasicInterface2

plugins/client/graphql-kotlin-client-generator/src/test/data/generator/interface_impl_diff_selection_sets/DifferentSelectionSetQuery.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ import com.expediagroup.graphql.generated.differentselectionsetquery.BasicInterf
66
import kotlin.String
77
import kotlin.reflect.KClass
88

9-
const val DIFFERENT_SELECTION_SET_QUERY: String =
9+
public const val DIFFERENT_SELECTION_SET_QUERY: String =
1010
"query DifferentSelectionSetQuery {\n first: interfaceQuery {\n __typename\n id\n ... on FirstInterfaceImplementation {\n intValue\n }\n ... on SecondInterfaceImplementation {\n floatValue\n }\n }\n second: interfaceQuery {\n __typename\n id\n ... on FirstInterfaceImplementation {\n name\n intValue\n }\n ... on SecondInterfaceImplementation {\n name\n floatValue\n }\n }\n}"
1111

12-
class DifferentSelectionSetQuery : GraphQLClientRequest<DifferentSelectionSetQuery.Result> {
13-
override val query: String = DIFFERENT_SELECTION_SET_QUERY
12+
public class DifferentSelectionSetQuery : GraphQLClientRequest<DifferentSelectionSetQuery.Result> {
13+
public override val query: String = DIFFERENT_SELECTION_SET_QUERY
1414

15-
override val operationName: String = "DifferentSelectionSetQuery"
15+
public override val operationName: String = "DifferentSelectionSetQuery"
1616

17-
override fun responseType(): KClass<DifferentSelectionSetQuery.Result> =
17+
public override fun responseType(): KClass<DifferentSelectionSetQuery.Result> =
1818
DifferentSelectionSetQuery.Result::class
1919

20-
data class Result(
20+
public data class Result(
2121
/**
2222
* Query returning an interface
2323
*/
24-
val first: BasicInterface,
24+
public val first: BasicInterface,
2525
/**
2626
* Query returning an interface
2727
*/
28-
val second: BasicInterface2
28+
public val second: BasicInterface2
2929
)
3030
}

0 commit comments

Comments
 (0)