Skip to content

Commit b5ae1c0

Browse files
authored
Upgrade to KotlinPoet v1.11.0, make corresponding required changes. (#1427)
### 📝 Description This PR updates the KotlinPoet dependency version to `v1.11.0`. There are two breaking changes [in this version](https://github.com/square/kotlinpoet/releases/tag/1.11.0) that affect graphql-kotlin: - KotlinPoet now enforces only allowed parameter modifiers in ParameterSpec (i.e. crossinline, vararg, and noinline). This required an actual fix in `GraphQLClientGenerator`. - KotlinPoet now emits trailing commas for multi-line parameters and annotations. In most cases the second change wouldn't be breaking, but because graphql-kotlin's test suite does an exact equality match against golden master queries, these started failing. Luckily regex can catch all these cases fairly easily. ### 🔗 Related Issues This resolves #1426 ### How tested? - Ran `./gradlew check`
1 parent 1545c1d commit b5ae1c0

File tree

113 files changed

+172
-172
lines changed

Some content is hidden

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

113 files changed

+172
-172
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ federationGraphQLVersion = 0.9.0
2525
graphQLJavaVersion = 18.0
2626
graphQLJavaDataLoaderVersion = 3.1.2
2727
jacksonVersion = 2.13.2
28-
kotlinPoetVersion = 1.10.2
28+
kotlinPoetVersion = 1.11.0
2929
ktorVersion = 2.0.0
3030
reactorVersion = 3.4.16
3131
reactorExtensionsVersion = 1.1.6

plugins/client/graphql-kotlin-client-generator/src/main/kotlin/com/expediagroup/graphql/plugin/client/generator/GraphQLClientGenerator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class GraphQLClientGenerator(
161161
operationTypeSpec.addProperty(variablesProperty)
162162

163163
val constructor = FunSpec.constructorBuilder()
164-
.addParameter("variables", variablesClassName, KModifier.OVERRIDE)
164+
.addParameter("variables", variablesClassName)
165165
.build()
166166
operationTypeSpec.primaryConstructor(constructor)
167167
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ public class AliasQuery : GraphQLClientRequest<AliasQuery.Result> {
2626
/**
2727
* Query that accepts some input arguments
2828
*/
29-
public val second: Boolean
29+
public val second: Boolean,
3030
)
3131
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ public class DocumentationQuery : GraphQLClientRequest<DocumentationQuery.Result
2323
/**
2424
* Query to test doc strings
2525
*/
26-
public val docQuery: DocObject
26+
public val docQuery: DocObject,
2727
)
2828
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ public data class DocObject(
1111
/**
1212
* An id with a comment containing % and $ as well
1313
*/
14-
public val id: Int
14+
public val id: Int,
1515
)

plugins/client/graphql-kotlin-client-generator/src/test/data/generator/include_skip_directives/IncludeSkipDirectivesQuery.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public const val INCLUDE_SKIP_DIRECTIVES_QUERY: String =
1313

1414
@Generated
1515
public class IncludeSkipDirectivesQuery(
16-
public override val variables: IncludeSkipDirectivesQuery.Variables
16+
public override val variables: IncludeSkipDirectivesQuery.Variables,
1717
) : GraphQLClientRequest<IncludeSkipDirectivesQuery.Result> {
1818
public override val query: String = INCLUDE_SKIP_DIRECTIVES_QUERY
1919

@@ -25,7 +25,7 @@ public class IncludeSkipDirectivesQuery(
2525
@Generated
2626
public data class Variables(
2727
public val includeCondition: Boolean,
28-
public val skipCondition: Boolean
28+
public val skipCondition: Boolean,
2929
)
3030

3131
@Generated
@@ -37,6 +37,6 @@ public class IncludeSkipDirectivesQuery(
3737
/**
3838
* Query that returns wrapper object with all supported scalar types
3939
*/
40-
public val scalarQuery: ScalarWrapper? = null
40+
public val scalarQuery: ScalarWrapper? = null,
4141
)
4242
}

plugins/client/graphql-kotlin-client-generator/src/test/data/generator/include_skip_directives/includeskipdirectivesquery/ScalarWrapper.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ public data class ScalarWrapper(
1111
/**
1212
* A signed 32-bit nullable integer value
1313
*/
14-
public val count: Int? = null
14+
public val count: Int? = null,
1515
)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ public class HardCodedInputQuery : GraphQLClientRequest<HardCodedInputQuery.Resu
2323
/**
2424
* Query that accepts some input arguments
2525
*/
26-
public val inputObjectQuery: Boolean
26+
public val inputObjectQuery: Boolean,
2727
)
2828
}

plugins/client/graphql-kotlin-client-generator/src/test/data/generator/input_lists/InputListQuery.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public const val INPUT_LIST_QUERY: String =
1111

1212
@Generated
1313
public class InputListQuery(
14-
public override val variables: InputListQuery.Variables
14+
public override val variables: InputListQuery.Variables,
1515
) : GraphQLClientRequest<InputListQuery.Result> {
1616
public override val query: String = INPUT_LIST_QUERY
1717

@@ -23,14 +23,14 @@ public class InputListQuery(
2323
public data class Variables(
2424
public val nullableIds: List<String?>? = null,
2525
public val nullableIdList: List<String>? = null,
26-
public val nonNullableIds: List<String>
26+
public val nonNullableIds: List<String>,
2727
)
2828

2929
@Generated
3030
public data class Result(
3131
/**
3232
* Query accepting list input
3333
*/
34-
public val listInputQuery: String? = null
34+
public val listInputQuery: String? = null,
3535
)
3636
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public const val SELF_REFERENCING_INPUT_QUERY: String =
1212

1313
@Generated
1414
public class SelfReferencingInputQuery(
15-
public override val variables: SelfReferencingInputQuery.Variables
15+
public override val variables: SelfReferencingInputQuery.Variables,
1616
) : GraphQLClientRequest<SelfReferencingInputQuery.Result> {
1717
public override val query: String = SELF_REFERENCING_INPUT_QUERY
1818

@@ -23,14 +23,14 @@ public class SelfReferencingInputQuery(
2323

2424
@Generated
2525
public data class Variables(
26-
public val input: ComplexArgumentInput? = null
26+
public val input: ComplexArgumentInput? = null,
2727
)
2828

2929
@Generated
3030
public data class Result(
3131
/**
3232
* Query that accepts self referencing input object
3333
*/
34-
public val complexInputObjectQuery: Boolean
34+
public val complexInputObjectQuery: Boolean,
3535
)
3636
}

0 commit comments

Comments
 (0)