Hello friends I'm writing my first ktor plugin for...
# ktor
j
Hello friends I'm writing my first ktor plugin for GraphQL Kotlin which is very nice, apart from the initial setup which is very not nice. It's my first ktor plugin, any feedback ? https://github.com/jmfayard/graphql-kotlin/blob/ktor-plugin/examples/server/ktor-s[…]/com/expediagroup/graphql/examples/server/ktor/GraphQLModule.kt
K 1
👀 3
m
I like the DSL that you have put together as the
ktor-server
from the expedia samples is very boilerplatey. Here I am wondering how would you inject dependencies into each of the services as objects are constructed on plugin initialization rather than a per-request basis; unless you'd shove that into the context map factory
I'd like to mention that the playground has been replaced by the more modern "studio.apollographql.com" which we can simply redirect with:
call.respondRedirect
for those that are allowed to use a third-party client rather than something that needs to be hosted on the same machine. This also involves some CORS handling
Actually nevermind on the DI. That should be handled through the GQL Context and you're providing a nice lambda for that ✅
j