martmists
11/22/2024, 11:29 AMgraphqls
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
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!