Skip to content

Commit

Permalink
Revert change to unvalidatedTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
oryan-block committed May 19, 2022
1 parent 236d20c commit 9dfa462
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ internal class SchemaClassScanner(
private val fieldResolverScanner = FieldResolverScanner(options)
private val typeClassMatcher = TypeClassMatcher(definitionsByName)
private val dictionary = mutableMapOf<TypeDefinition<*>, DictionaryEntry>()
private val unvalidatedTypes = mutableSetOf<TypeDefinition<*>>(*scalarDefinitions.toTypedArray())
private val unvalidatedTypes = mutableSetOf<TypeDefinition<*>>()
private val queue = linkedSetOf<QueueItem>()

private val fieldResolversByType = mutableMapOf<ObjectTypeDefinition, MutableMap<FieldDefinition, FieldResolver>>()
Expand Down
16 changes: 0 additions & 16 deletions src/test/kotlin/graphql/kickstart/tools/SchemaClassScannerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -454,7 +449,6 @@ class SchemaClassScannerTest {
})
.options(SchemaParserOptions.newOptions().includeUnusedTypes(true).build())
.dictionary(User::class)
.scalars(fieldSet)
.build()
.makeExecutableSchema()

Expand All @@ -477,16 +471,6 @@ class SchemaClassScannerTest {
var street: String? = null
}

private val fieldSet: GraphQLScalarType = GraphQLScalarType.newScalar()
.name("_FieldSet")
.description("_FieldSet")
.coercing(object : Coercing<String, String> {
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()
Expand Down

0 comments on commit 9dfa462

Please sign in to comment.