You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/graphql-kotlin-plugin-core/src/main/kotlin/com/expediagroup/graphql/plugin/generator/GraphQLClientGeneratorContext.kt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -38,5 +38,5 @@ data class GraphQLClientGeneratorContext(
38
38
val classNameCache:MutableMap<String, MutableList<ClassName>> =mutableMapOf()
39
39
val typeSpecs:MutableMap<String, TypeSpec> =mutableMapOf()
40
40
val typeAliases:MutableMap<String, TypeAliasSpec> =mutableMapOf()
Copy file name to clipboardExpand all lines: plugins/graphql-kotlin-plugin-core/src/main/kotlin/com/expediagroup/graphql/plugin/generator/types/generateGraphQLObjectTypeSpec.kt
Copy file name to clipboardExpand all lines: plugins/graphql-kotlin-plugin-core/src/main/kotlin/com/expediagroup/graphql/plugin/generator/types/generateInterfaceTypeSpec.kt
-1Lines changed: 0 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -131,7 +131,6 @@ internal fun generateInterfaceTypeSpec(
131
131
val unwrappedClassName = implementationClassName.copy(nullable =false)
132
132
// we point to original implementation name as that will be value from the __typename
Copy file name to clipboardExpand all lines: plugins/graphql-kotlin-plugin-core/src/main/kotlin/com/expediagroup/graphql/plugin/generator/types/generatePropertySpecs.kt
+1-7Lines changed: 1 addition & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -36,13 +36,7 @@ internal fun generatePropertySpecs(
Copy file name to clipboardExpand all lines: plugins/graphql-kotlin-plugin-core/src/main/kotlin/com/expediagroup/graphql/plugin/generator/types/generateTypeName.kt
* Generate custom [ClassName] reference to a Kotlin class representing GraphQL complex type (object, input object, enum, interface, union or custom scalar) and caches the value.
124
+
*/
125
+
internalfungenerateClassName(
126
+
context:GraphQLClientGeneratorContext,
127
+
graphQLType:NamedNode<*>,
128
+
selectionSet:SelectionSet? = null,
129
+
nameOverride:String? = null
130
+
): ClassName {
131
+
val typeName = nameOverride ?: graphQLType.name
132
+
val className =ClassName(context.packageName, "${context.rootType}.$typeName")
133
+
val classNames = context.classNameCache.getOrDefault(graphQLType.name, mutableListOf())
Copy file name to clipboardExpand all lines: plugins/graphql-kotlin-plugin-core/src/test/kotlin/com/expediagroup/graphql/plugin/generator/types/GenerateGraphQLInputObjectTypeSpecIT.kt
+65Lines changed: 65 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -61,4 +61,69 @@ class GenerateGraphQLInputObjectTypeSpecIT {
61
61
""".trimIndent()
62
62
verifyGeneratedFileSpecContents(query, expected)
63
63
}
64
+
65
+
@Test
66
+
fun`verify generation of self referencing input object`() {
Copy file name to clipboardExpand all lines: plugins/graphql-kotlin-plugin-core/src/test/kotlin/com/expediagroup/graphql/plugin/generator/types/GenerateGraphQLObjectTypeSpecIT.kt
+16-2Lines changed: 16 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -300,7 +300,7 @@ class GenerateGraphQLObjectTypeSpecIT {
300
300
}
301
301
302
302
@Test
303
-
fun`verify we can generate nested objects`() {
303
+
fun`verify we can generate self-reference objects`() {
0 commit comments