Skip to content

Commit

Permalink
Prevent polymorphic implementations from being overly cached (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
gscheibel authored and dariuszkuc committed Nov 13, 2018
1 parent ed0fde8 commit a795b41
Showing 1 changed file with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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))
}
Expand Down

0 comments on commit a795b41

Please sign in to comment.