graphql-kotlin

Code-only GraphQL schema generation for Kotlin

Github星跟踪图

GraphQL Kotlin

Build Status
codecov
Docs
Slack
Awesome Kotlin Badge

GraphQL Kotlin consists of number of libraries that aim to simplify running a GraphQL server in Kotlin.

? Modules

⌨️ Usage

Below is a basic example of how graphql-kotlin-schema-generator converts your Kotlin code into a GraphQL schema. For more details, see our documentation below or in the individual module READMEs

// Your existing Kotlin code

data class Widget(val id: Int, val value: String)

class WidgetService {
  fun widgetById(id: Int): Widget? {
    // grabs widget from a data source, might return null
  }
}

// Generate the schema

val config = SchemaGeneratorConfig(supportedPackages = listOf("org.example"))
val queries = listOf(TopLevelObject(WidgetService()))

toSchema(config, queries)

will generate

type Query {
  widgetById(id: Int!): Widget
}

type Widget {
  id: Int!
  value: String!
}

? Documentation

Examples and documentation are available on our documentation, or in each module README file.

If you have a question about something you can not find in our documentation, the indivdual modules, or javadocs, feel free to create an issue and tag it with the question label.

? Contact

This project is part of Expedia Group Open Source but also maintained by a dedicated team

✏️ Contributing

To get started, please fork the repo and checkout a new branch. You can then build the library locally with Gradle

./gradlew clean build

See more info in CONTRIBUTING.md

⚖️ License

This library is licensed under the Apache License, Version 2.0

主要指标

概览
名称与所有者ExpediaGroup/graphql-kotlin
主编程语言Kotlin
编程语言Kotlin (语言数: 6)
平台
许可证Apache License 2.0
所有者活动
创建于2018-09-13 22:41:30
推送于2025-05-12 12:19:05
最后一次提交2025-05-11 21:13:21
发布数260
最新版本名称9.0.0-alpha.8 (发布于 )
第一版名称0.0.1 (发布于 )
用户参与
星数1.8k
关注者数32
派生数359
提交数1.1k
已启用问题?
问题数583
打开的问题数60
拉请求数1147
打开的拉请求数12
关闭的拉请求数168
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?