aPureBase / KGraphQL

Pure Kotlin GraphQL implementation
https://kgraphql.io
MIT License
301 stars 58 forks source link

New Ktor feature implementation #102

Closed jeggy closed 4 years ago

jeggy commented 4 years ago

This should make it simpler to use and easier to extend in the future.

Before:

@UnstableDefault
@KtorExperimentalAPI
fun Application.module() {
  routing {
    graphql {
      query("hello") {
        resolver { -> "World!" }
      }
    }
  }
}

After:

fun Application.module() {
  install(GraphQL) {
    schema {
      query("hello") {
        resolver { -> "World!" }
      }
    }
  }
}

And now it uses it's own deserialization implementation. Which should fix issue #97 and others a like