https://kotlinlang.org logo
#graphql-kotlin
Title
# graphql-kotlin
d

Das135

10/21/2020, 7:43 AM
Hello! Is there any way to add Kotlin extension functions to schema generation? I have read some issues related to my question - if I understand correctly, graphql kotlin does not provide special funcionality for generating extension functions. But is there any workaround for this?
Copy code
data class First(
      val id: Long,
      val name: String
) {
   fun second(env: DataFetchingEnvironment): Second {
      //query second class
   }
}

fun First.another(env: DataFetchingEnvironment): Another {
// I need this function to be seen in graphql schema and resolver
}
d

Dariusz Kuc

10/21/2020, 3:03 PM
hello 👋 we currently don’t support processing extension functions out of the box
you should be able to add this functionality through schema hooks
4 Views