From a795b41080e8948c94c4694577017cb2914aed98 Mon Sep 17 00:00:00 2001 From: Guillaume Scheibel Date: Tue, 13 Nov 2018 09:18:04 -0800 Subject: [PATCH] Prevent polymorphic implementations from being overly cached (#64) --- .../com/expedia/graphql/schema/generator/SchemaGenerator.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/kotlin/com/expedia/graphql/schema/generator/SchemaGenerator.kt b/src/main/kotlin/com/expedia/graphql/schema/generator/SchemaGenerator.kt index 4587ca16ea..8153336841 100644 --- a/src/main/kotlin/com/expedia/graphql/schema/generator/SchemaGenerator.kt +++ b/src/main/kotlin/com/expedia/graphql/schema/generator/SchemaGenerator.kt @@ -291,9 +291,7 @@ internal class SchemaGenerator( .filterNot { it.kotlin.isAbstract } .forEach { val objectType = objectType(it.kotlin, interfaceType) - val key = TypesCacheKey(it.kotlin.createType(), false) - state.cache.put(key, KGraphQLType(it.kotlin, objectType)) if (objectType !is GraphQLTypeReference) { state.additionalTypes.add(objectType) } @@ -326,7 +324,6 @@ internal class SchemaGenerator( builder.possibleType(objectType as GraphQLObjectType) } - state.cache.put(key, KGraphQLType(it.kotlin, objectType)) if (state.cache.doesNotContain(it.kotlin)) { state.cache.put(key, KGraphQLType(it.kotlin, objectType)) }