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
{{ message }}
Repository navigation
Commit ad4ad8a
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: src/main/kotlin/graphql/kickstart/tools/SchemaClassScanner.kt
+23Lines changed: 23 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -113,6 +113,9 @@ internal class SchemaClassScanner(
113
113
handleDictionaryTypes(getAllObjectTypesImplementingDiscoveredInterfaces()) { "Object type '${it.name}' implements a known interface, but no class could be found for that type name. Please pass a class for type '${it.name}' in the parser's dictionary." }
114
114
if (scanQueue()) continue
115
115
116
+
// Discover unions listed as members of discovered unions, even when no field returns them.
117
+
if (handleNestedUnions()) continue
118
+
116
119
// Require all members of discovered unions to be discovered.
117
120
handleDictionaryTypes(getAllObjectTypeMembersOfDiscoveredUnions()) { "Object type '${it.name}' is a member of a known union, but no class could be found for that type name. Please pass a class for type '${it.name}' in the parser's dictionary." }
118
121
if (scanQueue()) continue
@@ -359,6 +362,22 @@ internal class SchemaClassScanner(
359
362
}.flatten().distinct()
360
363
}
361
364
365
+
/**
366
+
* Unions can list other unions as members. Returns whether any new unions were found.
367
+
*/
368
+
privatefunhandleNestedUnions(): Boolean {
369
+
val newUnions = dictionary.keys.filterIsInstance<UnionTypeDefinition>().flatMap { union ->
0 commit comments