I recently wrote a GraphQL Server as part of my Mu...
# graphql
m
I recently wrote a GraphQL Server as part of my Multiplatform-Everything project: https://github.com/Martmists-GH/multiplatform-everything It includes codegen for a client based on a
graphqls
schema file, and supports queries, mutations and subscriptions (using the
graphql-transport-ws
protocol). If you want to write graphql queries while sticking closely to the syntax with proper checking, you can now just write
Copy code
val me = myGraphQLClient.query {
    me {
        name
        id
        fragment on AdminUser {  // for lack of `... on AdminUser`
            capabilities
        }
    }
}
println(me.name)
if (me is AdminUser) {
    println(me.capabilities)
}
and it'll return fully typed data 🙂 As for the server, the DSL mostly inspired by KGraphQL with some small improvements where I felt it was necessary, as well as being fully suspending, supporting interface types, arguments and including error paths. Any feedback would be much appreciated!