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/client/graphql-kotlin-client-generator/src/main/kotlin/com/expediagroup/graphql/plugin/client/generator/GraphQLClientGenerator.kt
Copy file name to clipboardExpand all lines: plugins/client/graphql-kotlin-client-generator/src/main/kotlin/com/expediagroup/graphql/plugin/client/generator/GraphQLClientGeneratorContext.kt
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,7 @@ data class GraphQLClientGeneratorContext(
45
45
// shared type caches
46
46
val enumClassToTypeSpecs:MutableMap<ClassName, TypeSpec> =mutableMapOf()
47
47
val inputClassToTypeSpecs:MutableMap<ClassName, TypeSpec> =mutableMapOf()
48
+
val responseClassToTypeSpecs:MutableMap<ClassName, TypeSpec> =mutableMapOf()
48
49
val scalarClassToConverterTypeSpecs:MutableMap<ClassName, ScalarConverterInfo> =mutableMapOf()
49
50
val typeAliases:MutableMap<String, TypeAliasSpec> =mutableMapOf()
Copy file name to clipboardExpand all lines: plugins/client/graphql-kotlin-client-generator/src/main/kotlin/com/expediagroup/graphql/plugin/client/generator/types/generateTypeName.kt
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -258,3 +258,17 @@ private fun calculateSelectedFields(
258
258
}
259
259
return result
260
260
}
261
+
262
+
/**
263
+
* Generate a structural signature for a response type based on GraphQL type definition and selection set.
264
+
* This signature is used to identify structurally identical response types across different operations.
265
+
*/
266
+
internalfungenerateResponseTypeSignature(
267
+
graphQLTypeName:String,
268
+
selectionSet:SelectionSet?,
269
+
context:GraphQLClientGeneratorContext
270
+
): String {
271
+
if (selectionSet ==null) return graphQLTypeName
272
+
val selectedFields = calculateSelectedFields(context, graphQLTypeName, selectionSet)
0 commit comments