Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[client] Feedback on graphql-kotlin 3.0.0

See original GitHub issue

I’m just upgrading to graphql-kotlin 3.0.0 to try out using the new client within my integration tests. Here’s some feedback on things that I’m stumbling upon while working on the migration:

  • Documentation:

    • Code listing on build.gradle.kts doesn’t work for graphql settings. Should be grahql { client { ... } }
    • The above-mentioned code listing is IMO slightly confusing. AFAIU there are three options on how to retrieve the schema. It would be good to have code listings for each of these options. If there’s only one code listing it should IMO depict the default use-case and state so explicitly, i.e. have a little description about what the listing does right beneath.
    • IMO it would be good to mention the different client-generating tasks in the client overview (graphqlGenerateClient / graphqlGenerateTestClient)
  • I’m having trouble working with what should IMO be a typical use-case:

    • Use-case:
      • I have a project that implements a GraphQL API using graphql-kotlin
      • I want to run some integration tests against my backend, via graphql-kotlins client
      • I’d therefore like to download the schema and query files and put them into my source tree / VCS in order to enable backwards-compatibility checks
      • Client should be generated from the schema and query files in my source tree
    • Now, here’s the trouble I’m running into
      • I can’t run “gradle graphqlGenerateTestClient” because the backend is not running
      • I can’t run the backend using “gradle bootRun” because it tries to generate the client which doesn’t work because the backend is not running.
      • Any idea how to solve my issue?
      • From my build.gradle.kts:
graphql {
    client {
        endpoint = "http://localhost:8080/api/graphql"
        packageName = ""
        queryFiles = mutableListOf(
  • Trying to solve above-mentioned use case I also tried an approach in which schema and graphql files are stored within my source tree
    • Running gradle graphqlGenerateTestClient fails with: Invalid Syntax : offending token ')' at line 1 column 14
    • From my build.gradle.kts (in addition to the above listing with graphql { client { ... } }):
val graphqlGenerateTestClient by tasks.getting(com.expediagroup.graphql.plugin.gradle.tasks.GraphQLGenerateClientTask::class) {
  • Stack trace shows that error comes from the ANTLR-generated parser:
Caused by: graphql.parser.InvalidSyntaxException: Invalid Syntax : offending token ')' at line 1 column 14
        at graphql.parser.ExtendedBailStrategy.mkException(
        at graphql.parser.ExtendedBailStrategy.recoverInline(
        at org.antlr.v4.runtime.Parser.match(
        at graphql.parser.antlr.GraphqlParser.variable(
        at graphql.parser.antlr.GraphqlParser.variableDefinition(
        at graphql.parser.antlr.GraphqlParser.variableDefinitions(
        at graphql.parser.antlr.GraphqlParser.operationDefinition(
        at graphql.parser.antlr.GraphqlParser.definition(
        at graphql.parser.antlr.GraphqlParser.document(
        at graphql.parser.Parser.parseDocument(
        at graphql.parser.Parser.parseDocument(
        at graphql.parser.Parser.parseDocument(
        at com.expediagroup.graphql.plugin.generator.GraphQLClientGenerator.generate(GraphQLClientGenerator.kt:53)

To sum up my feedback…

  1. it would be great if the client documentation could be more of a step-by-step guide for one or multiple concrete typical use cases
  2. I have trouble with my use case and I’d appreciate some help 😃

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

dariuszkuccommented, Jun 2, 2020

Thank you for raising. Indeed we missed to update the doc for the client after I created to fix the config. If documentation is not clear or missing always feel free to raise a PR with updates 😃

smyrickcommented, Sep 4, 2020

@danbim I am going to close this issue. If you have a specific bug that needs to be resolved let’s create a new issue with details and a branch do demonstrate any issues

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introducing Apollo Kotlin - Apollo GraphQL Blog
Apollo Kotlin is a type-safe, caching GraphQL client. It takes your GraphQL queries and generates models that you can use in your application ......
Read more >
Hey folks i m trying to generate client classes from a schem
Hey folks, i'm trying to generate client classes from a schema.graphql file but the generated file is empty? I don't think my setup...
Read more >
Introducing GraphQL Kotlin Client | by Dariusz Kuc - Medium
Introducing a new Kotlin lightweight type-safe GraphQL HTTP client that leverages the power of Kotlin coroutines for fully asynchronous ...
Read more >
Bootiful GraphQL with Kotlin - YouTube
" GraphQL is a query language for APIs and a runtime for fulfilling those requests. GraphQL APIs are extremely powerful as clients use...
Read more >
release - Quarkus
Quarkus 3.0.0. ... Final with a lot of both internal and user facing improvements. ... upgrade for anyone exposing GraphQL services with Quarkus...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found