Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed a failure when attempting to find the appropriate resolver for …
…properties on data classes that have a return type of java.lang.Boolean. The java.lang.Boolean is not assignable to kotlin.Boolean::class.java. Kotlin's java platform types map to the primitive types, i.e. 'boolean'. In this case, we now check for 'boolean' as the class name. If there is a better way to do this, I'm not immediately aware. Added a test case to cover the Boolean case. Another failure occurred when assuming a Boolean|boolean value on a class used the 'is' prefix. This is a Java convention and is not enforced. Kotlin does not generate 'is' properties when declaring Boolean properties as it generates a 'get' prefix on vals/vars. Kotlin Boolean values would therefore fail the method lookup. Now first trying an 'is' then, if a boolean, trying the 'is' prefix as a last resort.
  • Loading branch information
Marc Miller committed Mar 24, 2017
commit e55ccf8628ec9cb5e45509c4855e4b593d084717
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import graphql.schema.DataFetchingEnvironment
import java.lang.reflect.Method

class ResolverDataFetcher(
val resolver: GraphQLResolver?,
val method: Method,
val passEnvironment: Boolean) : DataFetcher {
val resolver: GraphQLResolver?,
val method: Method,
val passEnvironment: Boolean) : DataFetcher {

companion object {
val mapper = ObjectMapper().registerKotlinModule()
Expand Down