From 9dfa462eb0b4186fa5e79fc0d2bed0c03748c6ed Mon Sep 17 00:00:00 2001 From: Oryan M Date: Thu, 19 May 2022 09:33:28 -0400 Subject: [PATCH] Revert change to unvalidatedTypes --- .../kickstart/tools/SchemaClassScanner.kt | 2 +- .../kickstart/tools/SchemaClassScannerTest.kt | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/main/kotlin/graphql/kickstart/tools/SchemaClassScanner.kt b/src/main/kotlin/graphql/kickstart/tools/SchemaClassScanner.kt index ffaeb5e4..5d529d2d 100644 --- a/src/main/kotlin/graphql/kickstart/tools/SchemaClassScanner.kt +++ b/src/main/kotlin/graphql/kickstart/tools/SchemaClassScanner.kt @@ -44,7 +44,7 @@ internal class SchemaClassScanner( private val fieldResolverScanner = FieldResolverScanner(options) private val typeClassMatcher = TypeClassMatcher(definitionsByName) private val dictionary = mutableMapOf, DictionaryEntry>() - private val unvalidatedTypes = mutableSetOf>(*scalarDefinitions.toTypedArray()) + private val unvalidatedTypes = mutableSetOf>() private val queue = linkedSetOf() private val fieldResolversByType = mutableMapOf>() diff --git a/src/test/kotlin/graphql/kickstart/tools/SchemaClassScannerTest.kt b/src/test/kotlin/graphql/kickstart/tools/SchemaClassScannerTest.kt index 576d1807..f5893618 100644 --- a/src/test/kotlin/graphql/kickstart/tools/SchemaClassScannerTest.kt +++ b/src/test/kotlin/graphql/kickstart/tools/SchemaClassScannerTest.kt @@ -434,11 +434,6 @@ class SchemaClassScannerTest { # these directives are defined in the Apollo Federation Specification: # https://www.apollographql.com/docs/apollo-server/federation/federation-spec/ - scalar _FieldSet - directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE - directive @extends on OBJECT | INTERFACE - directive @external on FIELD_DEFINITION - type User @key(fields: "id") @extends { id: ID! @external recentPurchasedProducts: [Product] @@ -454,7 +449,6 @@ class SchemaClassScannerTest { }) .options(SchemaParserOptions.newOptions().includeUnusedTypes(true).build()) .dictionary(User::class) - .scalars(fieldSet) .build() .makeExecutableSchema() @@ -477,16 +471,6 @@ class SchemaClassScannerTest { var street: String? = null } - private val fieldSet: GraphQLScalarType = GraphQLScalarType.newScalar() - .name("_FieldSet") - .description("_FieldSet") - .coercing(object : Coercing { - override fun parseValue(input: Any) = input.toString() - override fun serialize(dataFetcherResult: Any) = dataFetcherResult as String - override fun parseLiteral(input: Any) = input.toString() - }) - .build() - @Test fun `scanner should handle unused types with interfaces when option is true`() { val schema = SchemaParser.newParser()