aPureBase / KGraphQL

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

Temporary fix to support Ktor 2.0+ and the future of KGraphQL #185

Closed berserkore closed 2 years ago

berserkore commented 2 years ago

Hey folks,

Here is a temporary fix to support Ktor 2.0+ until the project get updated. I did not get any issues since this change and I hope it will be useful for you.

Step 1: Import the following file into your Ktor 2.0 project (as KtorPlugin.kt):

KtorPlugin.txt

Step 2: Install the above plugin import into your Application as such (Do not use the GraphQL import of the KGraphQL library):

install(GraphQL) {
     schema {
         mySchema()
      } 
}

Step 3: And voila, you should be able to use Ktor 2.0 and the current KGraphQL (0.17.14) into your projects. I know, it is not an ideal solution but it should keep you going with Ktor updates until the lib get revived.

Future of KGraphQL:

It is unfortunate not having updates for quite a while. Therefore, I suggest anyone to fork this library at least to review and merge any incoming PRs. To be honest, I haven't found any better alternatives which come close to the simplicity and practicability of this library. I think it would be a waste to terminated this project for lack of support. Until we get further notice from the maintainer, exploring the forking path would not be a bad idea.

Peace

PS: I hope @jeggy & his family are doing all right.

untoldwind commented 2 years ago

As an alternative (temporary) solution I created a fork-release on jitpack that is working fine in my project so far: https://jitpack.io/#untoldwind/KGraphQL/0.17.14-fork-2

jeggy commented 2 years ago

0.18.0 has now ktor 2.x support