Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aPureBase/KGraphQL
Pure Kotlin GraphQL implementation
https://github.com/aPureBase/KGraphQL
graphql kotlin
Last synced: 3 months ago
JSON representation
Pure Kotlin GraphQL implementation
- Host: GitHub
- URL: https://github.com/aPureBase/KGraphQL
- Owner: aPureBase
- License: mit
- Fork: true (pgutkowski/KGraphQL)
- Created: 2019-04-29T10:59:16.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-06-17T21:31:44.000Z (5 months ago)
- Last Synced: 2024-06-20T12:48:10.417Z (5 months ago)
- Topics: graphql, kotlin
- Language: Kotlin
- Homepage: https://kgraphql.io
- Size: 2.53 MB
- Stars: 296
- Watchers: 10
- Forks: 58
- Open Issues: 57
-
Metadata Files:
- Readme: README.MD
- License: LICENSE.md
Awesome Lists containing this project
- awesome-list - KGraphQL
README
# KGraphQL
[![Maven Central](https://img.shields.io/maven-central/v/com.apurebase/kgraphql.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.apurebase%22%20AND%20a:%22kgraphql%22)
[![Awesome Kotlin Badge](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin)
[![Chat](https://img.shields.io/badge/chat-on%20slack-green.svg)](https://kotlinlang.slack.com/messages/kgraphql)KGraphQL is a [Kotlin](https://kotlinlang.org/) implementation of [GraphQL](http://graphql.org/). It provides a rich DSL to set up the GraphQL schema.
```kotlin
data class Article(val id: Int, val text: String)fun main() {
val schema = KGraphQL.schema {
query("article") {
resolver { id: Int?, text: String ->
Article(id ?: -1, text)
}
}
type {
property("fullText") {
resolver { article: Article ->
"${article.id}: ${article.text}"
}
}
}
}schema.execute("""
{
article(id: 5, text: "Hello World") {
id
fullText
}
}
""".trimIndent()).let(::println)
}
```## Documentation
See the [documentation](https://kgraphql.io/) for a more detailed explanation of the library.## Contributing
All contributions are welcome. Feel free to open issues and PRs!
## Building
To build KGraphQL you only need to have JDK8 installed. invoke
```bash
./gradlew build
```To perform local build.
## Versioning
The versioning is following [Semantic Versioning](http://semver.org/)
## Links
Specification : http://facebook.github.io/graphql/
## License
KGraphQL is Open Source software released under the [MIT license](https://opensource.org/licenses/MIT)