diff --git a/apollo-execution-processor/src/main/kotlin/com/apollographql/execution/processor/definitions.kt b/apollo-execution-processor/src/main/kotlin/com/apollographql/execution/processor/definitions.kt index 212d709..526cc90 100644 --- a/apollo-execution-processor/src/main/kotlin/com/apollographql/execution/processor/definitions.kt +++ b/apollo-execution-processor/src/main/kotlin/com/apollographql/execution/processor/definitions.kt @@ -111,12 +111,6 @@ private class TypeDefinitionContext( } usedNames.add(name) - if (declaration.typeParameters.isNotEmpty()) { - logger.error("Generic classes are not supported") - typeDefinitions.put(qualifiedName, null) - continue - } - if (unsupportedTypes.contains(qualifiedName)) { logger.error( "'$qualifiedName' is not a supported built-in type. Either use one of the built-in types (Boolean, String, Int, Double) or use a custom scalar.", @@ -353,6 +347,7 @@ private class TypeDefinitionContext( GQLEnumValue(null, simpleName.asString()) } } + else -> { logger.error("Cannot convert $this to a GQLValue", argument) GQLNullValue(null) // not correct but compilation should fail anyway @@ -477,10 +472,7 @@ private class TypeDefinitionContext( private fun KSClassDeclaration.interfaces(): List { return getAllSuperTypes().mapNotNull { val declaration = it.declaration - if (it.arguments.isNotEmpty()) { - logger.error("Generic interfaces are not supported", this) - null - } else if (declaration is KSClassDeclaration) { + if (declaration is KSClassDeclaration) { if (declaration.asClassName().asString() == "kotlin.Any") { null } else if (declaration.containingFile == null) { diff --git a/tests/federation/src/main/kotlin/graphql.kt b/tests/federation/src/main/kotlin/graphql.kt index b09bed9..381daaf 100644 --- a/tests/federation/src/main/kotlin/graphql.kt +++ b/tests/federation/src/main/kotlin/graphql.kt @@ -1,8 +1,10 @@ import com.apollographql.execution.annotation.GraphQLQuery import com.apollographql.execution.subgraph.GraphQLKey +sealed interface SomeGenericInterface + @GraphQLQuery -class Query { +class Query: SomeGenericInterface{ fun products(): List { return products }