You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Using Kotlin extension functions in Resolvers #272
I'm using the graphql tools from Kotlin, and I would love to use extension functions in my resolver classes for readability:
packagesome.packageclassService(
valname:String,
valurl:String
)
classServiceResolver() : GraphQLResolver<Service> {
fun Service.healthy() =TODO("Check $url/health for 200 response")
}
From my experience with Kotlin, the extension function there should have exactly the same bytecode signature as a normal function with a Service object as the first parameter, however, loading the schema fails with a FieldResolverError, stating that a function with the signature of some.package.ServiceResolver.version(some.package.Service) can't be found.
This code worked before, when I was using com.graphql-java:graphql-java-tools:5.2.0, but after updating to version 5.6.0 that's now located in the com.graphql-java-kickstart group, I have to rewrite all extension functions like this to regular functions accepting a parameter to get it working again. Is there anyway using extension functions could be supported again?
Activity