Open
Description
Is your feature request related to a problem? Please describe.
Consider the following query:
fun echo(json: JsonNode?): JsonNode? = json
The type JsonNode
is an abstract class and resolved to a custom scalar as explained in the documentation:
fun schemaGeneratorHooks() = object : SchemaGeneratorHooks {
override fun willGenerateGraphQLType(type: KType): GraphQLType? {
return when (type.classifier) {
JsonNode::class -> jsonScalar
else -> null
}
}
}
However, this does not work. JsonNode is an abstract class, and generateArgument.kt
disallows those before resolving the type using the schema generator hooks.
Describe the solution you'd like
Move the check, that no interface / union would be generated from generateArgument.kt
to objectFromReflection (of course only check if it is an input type).
Describe alternatives you've considered
Currently, I use a workaround where I use Any
as Kotlin type and specify the scalar using @GraphQLType
, however, this results in unnecessary casts.