Skip to content

Commit c1fa633

Browse files
committed
Clean up
1 parent cfe4610 commit c1fa633

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/main/kotlin/graphql/kickstart/tools/SchemaClassScanner.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,16 @@ internal class SchemaClassScanner(
8484
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." }
8585
} while (scanQueue())
8686

87+
// Find unused types and include them if required
8788
if (options.includeUnusedTypes) {
8889
do {
8990
val unusedDefinitions = (definitionsByName.values - (dictionary.keys.toSet() + unvalidatedTypes))
9091
.filter { definition -> definition.name != "PageInfo" }
9192
.filterIsInstance<ObjectTypeDefinition>().distinct()
9293

93-
if (unusedDefinitions.isEmpty()) break
94+
if (unusedDefinitions.isEmpty()) {
95+
break
96+
}
9497

9598
val unusedDefinition = unusedDefinitions.first()
9699

src/test/groovy/graphql/kickstart/tools/SchemaClassScannerSpec.groovy

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
package graphql.kickstart.tools
22

3-
import graphql.language.InputObjectTypeDefinition
4-
import graphql.language.InputObjectTypeExtensionDefinition
5-
import graphql.language.InterfaceTypeDefinition
6-
import graphql.language.ObjectTypeDefinition
7-
import graphql.language.ScalarTypeDefinition
3+
import graphql.language.*
84
import graphql.schema.Coercing
95
import graphql.schema.GraphQLScalarType
106
import spock.lang.Specification
@@ -424,7 +420,8 @@ class SchemaClassScannerSpec extends Specification {
424420
name: String
425421
}
426422
427-
#these directives are defined in the Apollo Federation Specification: https://www.apollographql.com/docs/apollo-server/federation/federation-spec/
423+
# these directives are defined in the Apollo Federation Specification:
424+
# https://www.apollographql.com/docs/apollo-server/federation/federation-spec/
428425
type User @key(fields: "id") @extends {
429426
id: ID! @external
430427
recentPurchasedProducts: [Product]

0 commit comments

Comments
 (0)