Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apollo kotlin server #6196

Open
ronjunevaldoz opened this issue Oct 10, 2024 · 1 comment
Open

Apollo kotlin server #6196

ronjunevaldoz opened this issue Oct 10, 2024 · 1 comment

Comments

@ronjunevaldoz
Copy link

ronjunevaldoz commented Oct 10, 2024

Use case

Kotlin based graphql server. There are some existing kotlin server libraries:

Describe the solution you'd like

If I were to choose, I would choose the approach of kgraphql due to it's best suited for pure and declarative, the only problem is kgraphql maintainers are lacking and seems to be abandoned by the original owner while expedia graph-kotlin is an active community.

feature must support the following

  • pure kotlin
  • declarative like kgraphql
  • able to install ktor plugins (version 3.x.x if possible)
  • less boilerplate
  • easy to add queries, mutations, subscriptions
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<Article> {
            property<String>("fullText") {
                resolver { article: Article ->
                    "${article.id}: ${article.text}"
                }
            }
        }
    }

    schema.execute("""
        {
            article(id: 5, text: "Hello World") {
                id
                fullText
            }
        }
    """.trimIndent()).let(::println)
}

Please leave a comment about this feature requests. I would love to help to build this library.

@martinbonnin
Copy link
Contributor

Hi 👋 Thanks for the feature request. We'll discuss that with the team and update this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants