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 b6feaf7
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
+31-13Lines changed: 31 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -86,28 +86,42 @@ internal class SchemaClassScanner(
86
86
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." }
87
87
} while (scanQueue())
88
88
89
+
handleDirectives()
90
+
89
91
// Find unused types and include them if required
90
92
if (options.includeUnusedTypes) {
91
-
do {
92
-
val unusedDefinitions = (definitionsByName.values - (dictionary.keys.toSet() + unvalidatedTypes))
93
+
// One type at a time, since scanning it can discover other unused types along with their classes
94
+
while (true) {
95
+
val unusedDefinition = (definitionsByName.values - (dictionary.keys.toSet() + unvalidatedTypes))
handleDictionaryTypes(listOf(unusedDefinition)) { "Object type '${it.name}' is unused and includeUnusedTypes is true. Please pass a class for type '${it.name}' in the parser's dictionary." }
// Interfaces and unions are resolved through the classes of their implementations, so they don't need one
120
+
type isInterfaceTypeDefinition|| type isUnionTypeDefinition-> handleFoundType(type, null, UnusedTypeReference())
121
+
else->throwSchemaClassScannerError("Object type '${type.name}' is unused and includeUnusedTypes is true. Please pass a class for type '${type.name}' in the parser's dictionary.")
122
+
}
123
+
}
124
+
111
125
privatefunscanQueue(): Boolean {
112
126
if (queue.isEmpty()) {
113
127
returnfalse
@@ -463,6 +477,10 @@ internal class SchemaClassScanner(
0 commit comments