KGraphQL alternatives and similar libraries
Based on the "Web" category.
Alternatively, view KGraphQL alternatives based on common mentions on social networks and blogs.
-
javalin
DISCONTINUED. A simple and modern Java and Kotlin web framework [Moved to: https://github.com/javalin/javalin] -
apollo-android
:rocket: A strongly-typed, caching GraphQL client for the JVM, Android, and Kotlin multiplatform. -
http4k
The Functional toolkit for Kotlin HTTP applications. http4k provides a simple and uniform way to serve, consume, and test HTTP services. -
skrape.it
A Kotlin-based testing/scraping/parsing library providing the ability to analyze and extract data from HTML (server & client-side rendered). It places particular emphasis on ease of use and a high level of readability by providing an intuitive DSL. It aims to be a testing lib, but can also be used to scrape websites in a convenient fashion. -
hexagon
Hexagon is a microservices toolkit written in Kotlin. Its purpose is to ease the building of services (Web applications or APIs) that run inside a cloud platform. -
firefly
Firefly is an asynchronous web framework for rapid development of high-performance web application. -
tekniq
A framework designed around Kotlin providing Restful HTTP Client, JDBC DSL, Loading Cache, Configurations, Validations, and more -
Pellet
An opinionated, Kotlin-first web framework that helps you write fast, concise, and correct backend services 🚀. -
bootique-kotlin
DISCONTINUED. RETIRED. Provides extension functions and features for smooth development with Bootique and Kotlin. -
Zeko-RestApi
Asynchronous web framework for Kotlin. Create REST APIs in Kotlin easily with automatic Swagger/OpenAPI doc generation -
komock
KoMock - Simple HTTP/Consul/SpringConfig http server framework written in Kotlin. Wiremock use cases -
voyager-server-spring-boot-starter
Easily create REST endpoints with permissions (access control level) and hooks includeded
SaaSHub - Software Alternatives and Reviews
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of KGraphQL or a related project?
README
KGraphQL
Disclaimer
I am no longer able to maintain this project. Please go to https://github.com/aPureBase/KGraphQL, where KGraphQL is still developed.
KGraphQL is Kotlin implementation of GraphQL. It provides rich DSL to setup GraphQL schema.
Introduction
As example, let's partially reproduce part of Star Wars schema from official GraphQL tutorial. First, we need to define our domain model, by plain kotlin classes:
enum class Episode {
NEWHOPE, EMPIRE, JEDI
}
interface Character {
val id : String
val name : String?
val friends: List<Character>
val appearsIn: Set<Episode>
}
data class Human (
override val id: String,
override val name: String?,
override val friends: List<Character>,
override val appearsIn: Set<Episode>,
val homePlanet: String,
val height: Double
) : Character
data class Droid (
override val id: String,
override val name: String?,
override val friends: List<Character>,
override val appearsIn: Set<Episode>,
val primaryFunction : String
) : Character
Next, we define our data
val luke = Human("2000", "Luke Skywalker", emptyList(), Episode.values().toSet(), "Tatooine", 1.72)
val r2d2 = Droid("2001", "R2-D2", emptyList(), Episode.values().toSet(), "Astromech")
Then, we can create schema:
//KGraphQL#schema { } is entry point to create KGraphQL schema
val schema = KGraphQL.schema {
//configure method allows you customize schema behaviour
configure {
useDefaultPrettyPrinter = true
}
//create query "hero" which returns instance of Character
query("hero") {
resolver {episode: Episode -> when(episode){
Episode.NEWHOPE, Episode.JEDI -> r2d2
Episode.EMPIRE -> luke
}}
}
//create query "heroes" which returns list of luke and r2d2
query("heroes") {
resolver{ -> listOf(luke, r2d2)}
}
//kotlin classes need to be registered with "type" method
//to be included in created schema type system
//class Character is automatically included,
//as it is return type of both created queries
type<Droid>()
type<Human>()
enum<Episode>()
}
Now, we can query our schema:
//query for hero from episode JEDI and take id, name for any Character, and primaryFunction for Droid or height for Human
schema.execute("{hero(episode: JEDI){
id
name
... on Droid{primaryFunction}
... on Human{height}
}
}")
Returns:
{
"data" : {
"hero" : {
"id" : "2001",
"name" : "R2-D2",
"primaryFunction" : "Astromech"
}
}
}
Query for all heroes:
//query for all heroes and take id, name for any Character, and primaryFunction for Droid or height for Human
schema.execute("{heroes {
id
name
... on Droid{primaryFunction}
... on Human{height}
}
}")
Returns:
{
"data" : {
"heroes" : [ {
"id" : "2000",
"name" : "Luke Skywalker",
"height" : 1.72
}, {
"id" : "2001",
"name" : "R2-D2",
"primaryFunction" : "Astromech"
} ]
}
}
As stated by GraphQL specification, client receives only what is requested. No more, no less.
Detailed documentation can be found in wiki. For more examples, see KGraphQL demo application: KGraphQL-NBA2012
Building
To build KGraphQL you only need to have JDK8 installed. invoke
./gradlew build
To perform local build.
Versioning
The versioning is following Semantic Versioning
Links
Specification : http://facebook.github.io/graphql/
License
KGraphQL is Open Source software released under the MIT license
*Note that all licence references and agreements mentioned in the KGraphQL README section above
are relevant to that project's source code only.