Closed jmfayard closed 1 year ago
Hello any thoughts on this? Even if you don't have the bandwith to implelment it, would be nice to know if such a plugin would go in the right direction
@jmfayard I think it's a great idea but its hihgly unlikely to be implemented anytime soon* (I am no longer with Expedia so may be wrong)
*unless someone from community contributes a PR. I think your example in the issue is a good start - maybe you could open a PR?
@samuelAndalon @tapaderster any thoughts on your side?
@jmfayard the idea sound really cool, as currently we only support out of the box auto-configuration for spring server, if we implement a ktor plugin would be super beneficial for the ktor community. Feel free to continue working on it/open a PR we will for sure take a look at it.
Is your feature request related to a problem? Please describe.
We use graphql-kotlin with ktor at https://tignum.com/ and we really like it.
The initial setup OTOH is not so nice. It made my head explode when I first set-it up, and then it made the head of my colleagues explode when I explained it to them.
The ktor way to install new feature is :
install(ThePlugin)
Describe the solution you'd like
I had a shot at what such a plugin could look like.
Have a look at https://github.com/ExpediaGroup/graphql-kotlin/compare/master...jmfayard:ktor-plugin?expand=1
The simplest setup for
graphql-kotlin/examples/server/ktor-server
would be:and your main file:
For a more advanced setup you could use those optional parameters
Describe alternatives you've considered
The alternative is to currently copy-paste the boilerplate from
graphql-kotlin/examples/server/ktor-server
and try to figure whatGraphQlContextFactory
,KtorGraphQLRequestParser
,KtroGraphQLSchema
,KtorGraphQlSchema
,KtorServer
and the likes are doing.Additional context
Ktor documentation: