Skip to content
This repository has been archived by the owner on May 16, 2019. It is now read-only.

Commit

Permalink
use extension function instead of resolverKF
Browse files Browse the repository at this point in the history
  • Loading branch information
pabl0rg committed Mar 22, 2019
1 parent cc27bdd commit e8dfd02
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object BenchmarkSchema {
resolver(threeResolver)
}
query("threeKF"){
resolverKF(HasOneResolver::oneResolver)
HasOneResolver::oneResolver.toResolver()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class QueryOrMutationDSL(
return ResolverDSL(this)
}

fun <T>resolverKF(function: KFunction<T>) = resolver(FunctionWrapper.on(function))
fun <T>KFunction<T>.toResolver() = resolver(FunctionWrapper.on(this))

fun <T>resolver(function: () -> T) = resolver(FunctionWrapper.on(function))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ class SchemaBuilderTest {

val tested = defaultSchema {
query("mainActor") {
resolverKF(actorService::getMainActor)
actorService::getMainActor.toResolver()
}

query("actorById") {
resolverKF(actorService::getActor)
actorService::getActor.toResolver()
}

type<Actor> {
Expand Down

0 comments on commit e8dfd02

Please sign in to comment.