forked from pgutkowski/KGraphQL
-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Description
I believe graphql doesn't need a plugin. Instead, it needs a
routing extension just like the get
and post
extensions.
For example:
fun Route.configureGraphql() {
route("/graphql") {
graphqlPlayground()
graphql {
wrapErrors = true
schema {
firstSchema()
secondSchema()
thierdSchema()
firstRootSchema()
secondRootSchema()
thierdRootSchema()
}
}
}
}
This way we don't need the wrapWith: {...}
and endpoint: String
and playground: Boolean
arguments in the configuration object.
And gives us more flexibility and control over handling execution
exceptions.
I made a library/utility implementing this design
https://github.com/lsafer/kgraphql-ktor
In this library I implemented the described design.
Additionally, I fixed serialization issues and error
handling.
MaaxGr, jeggy, ESchouten, Ischca, IceBlizz6 and 2 morebrezinajn
Metadata
Metadata
Assignees
Labels
No labels