Libraries for running GraphQL in Kotlin

Overview

GraphQL Kotlin

Continuous Integration Publish Docs Discussions Slack

GraphQL Kotlin is a collection of libraries, built on top of graphql-java, that simplify running GraphQL clients and servers in Kotlin.

Visit our documentation site for more details.

📦 Modules

  • clients - Lightweight GraphQL Kotlin HTTP clients based on Ktor HTTP client and Spring WebClient
  • examples - Example apps that use graphql-kotlin libraries to test and demonstrate usages
  • generator - Code-First schema generator and extensions to build Apollo Federation schemas
  • plugins - Gradle and Maven plugins
  • servers - Common and library specific modules for running a GraphQL server

⌨️ Usage

While all the individual modules of graphql-kotlin are published as stand-alone libraries, the most common use cases are running a server, and genereating a type-safe client.

Server Example

A basic example of how you can run a GraphQL server can be found on our server documentation section.

Client Example

A basic setup of a GraphQL client can be found on our client documentation section.

📋 Documentation

More examples and documentation are available on our documentation site hosted in GitHub Pages. We also have the examples module which can be run locally for testing and shows example code using the libraries.

If you have a question about something you can not find in our documentation, the indivdual module READMEs, or javadocs, feel free to contribute to the docs or start a disucssion and tag it with the question label.

If you would like to contribute to our documentation see the website directory for more information.

🗞 Blog Posts and Videos

The Blogs & Videos page in the GraphQL Kotlin documentation links to blog posts, release announcements, conference talks about the library, and general talks about GraphQL at Expedia Group.

👥 Contact

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

If you have a specific question about the library or code, please start a disucssion for the community.

We also have a public channel, (#graphql-kotlin), open on the Kotlin Slack instance (kotlinlang.slack.com). See the info here on how to join this slack instance.

✏️ 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.

After you have your local branch set up, take a look at our open issues to see where you can contribute.

🛡️ Security

For more info on how to contact the team for security issues or the supported versions that receive security updates, see SECURITY.md

⚖️ License

This library is licensed under the Apache License, Version 2.0

Comments
  • Reactor - Flux and Mono can't get them to work at all

    Reactor - Flux and Mono can't get them to work at all

    So I've been hammering away at this for a day and I can't seem to get even basic queries to work with mono or flux.

    Below is an example of a query to a user profile from the identity store. If I convert this into a future it works out of the box, but the moment I use a mono i get all my fields as null

    {"data":{"currentUserProfile":{"firstname":null,"lastname":null,"username":null,"emailAddress":null}}}
    

    And the query code:

    @PreAuthorize("isAuthenticated()")
        fun currentUserProfile(context: GraphQLSecurityContext): Mono<UserProfile> {
            return context.securityContext.flatMap { sc ->
                val details = sc.authentication.details as UserCredential
                userIdentityService.findById(details.id).map { UserProfile.fromUserIdentity(it) }
            }
    

    I don't seem to have a problem generating schema with mono. I have registered a monad hook, but it seems to do nothing.

    Is there something I'm doing wrong? I know it does call the query method, but I can't seem to figure out I get a null response.

    opened by ianmichell 32
  • Subscription stops working doing automated tests

    Subscription stops working doing automated tests

    Library Version 1.4.2

    Describe the bug When running a load test, I very early on get time-outs. I have a comparable implementation using Java, and it runs a whole lot longer. It's about 2 minutes vs. 30 minutes. I don't see any error in the logs. What will happen is that every second a couple of times a subscription will be started, a message will be received, through Kafka and Webflux, and then the subscription will be stopped again. A preliminary comparison can be found here.

    To Reproduce At kafka-graphql-examples the implementation can be found. It's possible on mac/linux to run the whole test using the scripts. I know this is quite a lot, and the test is doing a lot more than needed. I might try to create a test in Kotlin, using the example project that produces a similar result.

    Expected behavior To be at least on par with the java version, or be faster because of the use of coroutines.

    I saw there was already an open issue for changing the subscription implementation, https://github.com/ExpediaGroup/graphql-kotlin/issues/358. It might fix the problem.

    type: bug 
    opened by gklijs 20
  • [plugin] generated client should support default values

    [plugin] generated client should support default values

    Is your feature request related to a problem? Please describe. I am frustrated when I try to mock the client for testing. I love the automatic generation of the kotlin files very much, so would prefer to continue to be able to do that. But when I mock I need to give every single field a value. As it is already marked as nullable I can put null into it, but with kotlin it has to be defined.

    Describe the solution you'd like I would like a flag or even a default behaviour, that the nullable fields are generated with a default value of null, so they do not have to be specified when creating a new instance of the generated classes

    type: enhancement module: plugin 
    opened by huehnerlady 19
  • Client can't deserialize GraphQL response

    Client can't deserialize GraphQL response

    Hi, I'm having some trouble with the GraphQL client (version 3.6.1). I'm getting an exception when GraphQLClient is trying to deserialize the response data to GraphQLResponse<HubCheckOut.Result>. The model itself looks fine and matches the JSON, but for some reason Jackson is not able to map it.

    If I use a debugger to manually serialize to Map<String, Any> with the mapper it works, so the JSON is fine. Any ideas?

    This is the generated model class:

    const val HUB_CHECK_OUT: String =
        "mutation HubCheckOut(${'$'}hubID: ID!, ${'$'}employeeID: ID!) {\n    insertHubCheckedOutLogRecord(input: {hubId: ${'$'}hubID, employeeId: ${'$'}employeeID}) {\n        record {\n            shiftId\n        }\n    }\n}"
    
    class HubCheckOut(
      private val graphQLClient: GraphQLClient<*>
    ) {
      suspend fun execute(variables: HubCheckOut.Variables, requestBuilder: HttpRequestBuilder.() ->
          Unit = {}): GraphQLResponse<HubCheckOut.Result> = graphQLClient.execute(HUB_CHECK_OUT,
          "HubCheckOut", variables, requestBuilder)
    
      data class Variables(
        val hubID: ID,
        val employeeID: ID
      )
    
      data class ShiftStateHubLogRecord(
        val shiftId: ID?
      )
    
      data class InsertHubLogCheckedOutRecordResponse(
        val record: HubCheckOut.ShiftStateHubLogRecord
      )
    
      data class Result(
        val insertHubCheckedOutLogRecord: HubCheckOut.InsertHubLogCheckedOutRecordResponse?
      )
    }
    

    And the exception:

    Strange Map type java.util.Map: cannot determine type parameters
     at [Source: (String)"{"data":{"insertHubCheckedOutLogRecord":{"record":{"shiftId":"6387e498-2ac2-3c76-9b9e-f5248a348f8b"}}}}"; line: 1, column: 1]
    com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Strange Map type java.util.Map: cannot determine type parameters
     at [Source: (String)"{"data":{"insertHubCheckedOutLogRecord":{"record":{"shiftId":"6387e498-2ac2-3c76-9b9e-f5248a348f8b"}}}}"; line: 1, column: 1]
    	at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:62)
    	at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer(BeanDeserializerFactory.java:227)
    	at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:143)
    	at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:414)
    	at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:349)
    	at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264)
    	at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244)
    	at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142)
    	at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:491)
    	at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:4711)
    	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4520)
    	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3466)
    	at com.expediagroup.graphql.client.GraphQLClient.execute$suspendImpl(GraphQLClient.kt:91)
    	at com.expediagroup.graphql.client.GraphQLClient$execute$1.invokeSuspend(GraphQLClient.kt)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:216)
    	at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:172)
    	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:67)
    	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:122)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:216)
    	at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:172)
    	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:67)
    	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:122)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:216)
    	at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:172)
    	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:67)
    	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:122)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:216)
    	at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:172)
    	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:67)
    	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:122)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(PipelineContext.kt:216)
    	at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:172)
    	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:67)
    	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(PipelineContext.kt:122)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
    	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
    	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:84)
    	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
    	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
    	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    	at io.moia.driver.shift.validation.apitest.TestRun.start(TestRun.kt:94)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:686)
    	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
    	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
    	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
    	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
    	at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
    	at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
    	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
    	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:212)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:208)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:137)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:71)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
    	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
    	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
    	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
    	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
    	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
    	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
    	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
    	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
    	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
    	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
    	at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
    	at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
    	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
    	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
    	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:99)
    	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:79)
    	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:75)
    	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
    	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
    	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
    	at com.sun.proxy.$Proxy5.stop(Unknown Source)
    	at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:132)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
    	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
    	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
    	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:412)
    	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    	at java.base/java.lang.Thread.run(Thread.java:834)
    
    type: bug status: blocked upstream 
    opened by hrkfdn 15
  • Query types decapitalised

    Query types decapitalised

    Hello, I have the following schema:

    type Month implements Period {
       id: String!
       value: Int!
    }
    

    but the augmented (generated schema) decapitalizes the type, so instead of Month, I get month as the generated query. Is there any config where I can change this behaviour?

    opened by magaton 14
  • how to implement authentication scheme?

    how to implement authentication scheme?

    How can I build something like this:

    class HelloQuery: Query {
    
        @IsAuthenticated
        fun helloAuthenticatedUser(): String = "Hello Authenticated User"
    
        @IsAdmin
        fun helloAdmin(): String = "Hello Admin"
    }
    

    base on: https://youtu.be/xaorvBjCE7A?t=580

    opened by aarestu 14
  • DataFetchingException: Object is not an instance of declaring class

    DataFetchingException: Object is not an instance of declaring class

    Library Version "com.expediagroup:graphql-kotlin-spring-server:2.1.1"

    Describe the bug I'm currently using spring webflux and spring server auto config package with graphql-kotlin, I am returning an instance of a class and it would work fine, but when I make changes or any changes for that matter, I would get these errors: image I'm currently using spring-devtool and every time I make a change, it would build the file in intellij ide. This issue doesn't occur when I just stop and rebuild the entire server. Just wondering if this is a known issue or is it just me?

    To Reproduce Steps to reproduce the behavior. Please provide: This is my sample code, which is very basic: image Then go ahead and make any changes or add a println, then hit build in which devtool should kick in and reload the changes. Then if you fetch for the data again in playground, it will produce this issue.

    Expected behavior This should happen: image

    But if I make any changes and the code get build with spring devtool, the second time I run it again, I would get this "Object is not an instance of declaring class". Btw, love the library and it's been awesome running with it, just wondering if this is an issue with spring-devtool

    type: bug 
    opened by sinwailam193 13
  • Load pre-compiled GraphQLSchema at application startup time

    Load pre-compiled GraphQLSchema at application startup time

    Is your feature request related to a problem? Please describe. I'm currently running my application in a serverless environment. Therefore, I am interested in minimizing startup time (recognizing that the JVM as a whole has limitations here). I've found that the creation of the GraphQLSchema object takes up the vast majority of my current startup time -- initializing takes about 4 seconds and about 75% of that seems to be GraphQLSchema construction.

    Describe the solution you'd like I'd like a mechanism to build and serialize the GraphQLSchema so that it can simply be loaded at runtime, instead of the schema being generated at runtime based on runtime introspection.

    Describe alternatives you've considered Obviously moving off of a serverless environment towards long-running server processes works around the issue. However, this is not always an ideal scenario at the early stages of a business looking to minimize costs when traffic is low.

    Additional context Add any other context or screenshots about the feature request here.

    type: enhancement 
    opened by rocketraman 12
  • Lazy load models (Spring boot)

    Lazy load models (Spring boot)

    Is it possible to use this with Hibernate "lazy-load" relations?

    As of now, the Hibernate Session is closed after returning the result from the repository, and then when calculating the graphql and accessing the lazy fields it crashes because there's no session. Is there any way to use "lazy-load" relations with this library?

    opened by JoniDS 12
  • Support hooks to add custom documentation to objects, fields, arguments and enum values

    Support hooks to add custom documentation to objects, fields, arguments and enum values

    We came up with a documentation technique that works well for us (syncing both development teams and our product documentation team). We're trying to resolve the relevant Markdown documentation for each object, field, argument and enum value.

    SchemaGeneratorHooks is an awesome general purpose vehicle for intercepting schema generation. I think it can be very helpful in this case, but it would have to be extended to include hook methods that would allow me to augment builder objects just before calling build(). That way I can call the builders' description method and add my own documentation. Specifically I'm asking for the inclusion of the following hooks:

    fun willGenerateGraphQLObject(objectName: String, builder: graphql.schema.GraphQLObjectType.Builder): graphql.schema.GraphQLObjectType.Builder = builder
    
    fun willGenerateGraphQLField(objectName: String, fieldName: String, builder: graphql.schema.GraphQLFieldDefinition.Builder): graphql.schema.GraphQLFieldDefinition.Builder = builder
    
    fun willGenerateGraphQLEnumType(enumName: String, builder: graphql.schema.GraphQLEnumType.Builder): graphql.schema.GraphQLEnumType.Builder = builder
    
    fun willGenerateGraphQLEnumValue(enumName: String, enumValue: String, builder: graphql.schema.GraphQLEnumValueDefinition.Builder): graphql.schema.GraphQLEnumValueDefinition.Builder = builder
    
    fun willGenerateGraphQLArgument(objectName: String, fieldName: String, argumentName: String, builder: graphql.schema.GraphQLArgument.Builder): graphql.schema.GraphQLArgument.Builder = builder
    
    

    I added the names of the objects/fields/arguments/enums to the hooks' contexts since it's difficult to extract that information from the builders directly.

    What do you think?

    Thanks a lot for a fantastic library!

    type: enhancement 
    opened by liqweed 11
  • Additional SchemaGeneratorHook that allows modifying GraphQLTypes.

    Additional SchemaGeneratorHook that allows modifying GraphQLTypes.

    This enables rewiring based on directives (see #60) by offering general purpose hooks that allows us to rewire/modify generated graphqltypes.

    The base example for directive based authentication, would work with this: https://www.graphql-java.com/documentation/v11/sdl-directives/

    With this hook available I can then use a helper class such as this can be used to wire up the directives: https://gist.github.com/d4rken/7cb60a6a7b315d25766ff15884f9b99b

    The new hook has a placeholder WiringContext which would need to get some functionality to allow for feature parity with graphql-java's SchemaDirectiveEnvironment

    I was a bit out of my depth there though and couldn't find a clean solution.

    Theoretically we could just keep it empty until someone needs the functionality then provide it. As it's passed via "context" object this wouldn't lead to breaking changes. WiringContext is created inside the SchemaGenerator where it would have access to the necessary information it's just unclear in what form to provide it.

    I think it comes down to how close we want to mirror graphql-java and it's SchemaDirectiveWiringEnvironment...

    opened by d4rken 11
  • Generated GQL client causes `kotlinx.serialization` compiler recursion error

    Generated GQL client causes `kotlinx.serialization` compiler recursion error

    Library Version Kotlin Version: 1.8.0 (also tested 1.7.20)

    id("com.expediagroup.graphql") version "6.3.3"
    
    ...
    
    implementation("com.expediagroup:graphql-kotlin-spring-client:6.3.3") {
            exclude("com.expediagroup", "graphql-kotlin-client-jackson")
        }
    implementation("com.expediagroup:graphql-kotlin-client-serialization:6.3.3")
    

    Describe the bug After switching from Jackson to kotlinx.serialization the generated code no longer compiles. It fails in the step kotlinCompile with the exception.

    org.jetbrains.kotlin.util.KotlinFrontEndException: Front-end Internal error: Failed to analyze declaration Variables
    File being compiled: (30,3) in /Users/christian/dev/doms-ecom-integration/build/generated/source/graphql/main/test/CreateFulfilmentOption.kt
    The root cause java.lang.AssertionError was thrown at: org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassDescriptor.getModality(LazyClassDescriptor.java:584)
    	at org.jetbrains.kotlin.resolve.ExceptionWrappingKtVisitorVoid.visitDeclaration(ExceptionWrappingKtVisitorVoid.kt:43)
    	at org.jetbrains.kotlin.psi.KtVisitorVoid.visitDeclaration(KtVisitorVoid.java:461)
    	at org.jetbrains.kotlin.psi.KtVisitorVoid.visitDeclaration(KtVisitorVoid.java:21)
    	at org.jetbrains.kotlin.psi.KtVisitor.visitNamedDeclaration(KtVisitor.java:406)
    
    ...
    
    Caused by: java.lang.AssertionError: Recursion detected in a lazy value under LockBasedStorageManager@756f0f2d (TopDownAnalyzer for JVM)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassDescriptor.getModality(LazyClassDescriptor.java:584)
    	at org.jetbrains.kotlinx.serialization.compiler.resolve.KSerializationUtilKt.getShouldHaveGeneratedSerializer(KSerializationUtil.kt:138)
    	at org.jetbrains.kotlinx.serialization.compiler.extensions.SerializationResolveExtension.generateSyntheticClasses(SerializationResolveExtension.kt:78)
    

    The generated code looks like this

    @Generated
    @Serializable
    public class CreateFulfilmentOption(
      public override val variables: CreateFulfilmentOption.Variables,
    ) : GraphQLClientRequest<CreateFulfilmentOption.Result> {
      @Required
      public override val query: String = CREATE_FULFILMENT_OPTION
    
      @Required
      public override val operationName: String = "CreateFulfilmentOption"
    
      public override fun responseType(): KClass<CreateFulfilmentOption.Result> =
          CreateFulfilmentOption.Result::class
    
      @Generated
      @Serializable
      public data class Variables(
        public val input: CreateFulfilmentOptionInput,
        public val executionMode: ExecutionMode? = null,
      )
    
      @Generated
      @Serializable
      public data class Result(
        public val createFulfilmentOption: FulfilmentOption? = null,
      )
    }
    
    

    The problem seems to be related to the nested class Result. After moving it outside of CreateFulfilmentOption the error is gone

    To Reproduce Generate client code with kotlinx serialiser and try to compile with the described version.

    Expected behavior The generated code compiles

    type: bug 
    opened by holzerch 0
  • Upgrade to Ktor 2.2.1

    Upgrade to Ktor 2.2.1

    Describe the solution you'd like

    Please upgrade Ktor to the newly release version 2.2.0 (from current version 2.0.3).

    Describe alternatives you've considered

    Sticking to Ktor 2.0.3 / up to 2.1.3 downstream is technically possible, but consumer will not be able to beneiot from new Ktor 2.2.0 features.

    Additional context

    Upgrading downstream to Ktor 2.2.0 results in java.lang.NoClassDefFoundError: kotlinx/atomicfu/AtomicFU.

    type: enhancement 
    opened by sschuberth 3
  • use new Spring Boot auto-configuration

    use new Spring Boot auto-configuration

    Library Version com.expediagroup:graphql-kotlin-spring-server:7.0.0-alpha.0

    Describe the bug When switchen to Spring Boot 3 com.expediagroup.graphql.server.spring.GraphQLAutoConfiguration does not get executed, because the old way of registering them via spring.factories has been removed. The new way needs a META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports-File.

    Additional Info Details about the introduction of the new mechanism, and the deactivation of the old one.

    As a workaround i can get my project to work, by registering com.expediagroup.graphql.server.spring.GraphQLAutoConfiguration myself with a META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports in my own application.

    changes: major module: server 
    opened by snv 0
  • Please Upgrade federation-graphql-java-support to prevent CVE-2022-3171

    Please Upgrade federation-graphql-java-support to prevent CVE-2022-3171

    Library Version com.expediagroup:graphql-kotlin-spring-server:7.0.0-alpha.0

    Describe the bug I get warned about CVE-2022-3171, because of the transitive dependency along

    com.expediagroup:graphql-kotlin-spring-server:7.0.0-alpha.0
    -> com.expediagroup:graphql-kotlin-federation:7.0.0-alpha.0
      -> com.apollographql.federation:federation-graphql-java-support:2.0.7
        -> com.google.protobuf:protobuf-java:3.21.5
    

    This is supposed to be fixed since protobuf Version 21.7, which gets updated by com.apollographql.federation:federation-graphql-java-support since v.2.1.0

    type: bug module: server 
    opened by snv 1
  • [spec] add graphql-kotlin-spring-server implementation to graphql-http

    [spec] add graphql-kotlin-spring-server implementation to graphql-http

    Is your feature request related to a problem? Please describe. GraphQL HTTP is a lightweight implementation of the GraphQL over HTTP spec. That repository also contains a number of tests that verify whether underlying server is compatible with HTTP spec or not. We should make sure that graphql-kotlin-spring-server is HTTP spec compliant and add its implementation to the list of tested libraries.

    Describe the solution you'd like graphql-kotlin server implementation added to the HTTP spec repo that is fully compatible with the spec.

    Describe alternatives you've considered N/A

    Additional context Related: https://github.com/ExpediaGroup/graphql-kotlin/issues/1573

    type: enhancement 
    opened by dariuszkuc 0
  • [spring-server] replace playground with graphiql

    [spring-server] replace playground with graphiql

    Is your feature request related to a problem? Please describe. Originally we chose Playground as it was much more feature rich than GraphiQL. Since then project was deprecated in favor of GraphiQL v2 which has full feature parity (and then recently un-deprecated with potential rewrite to reuse GraphiQL internals, still TBD).

    Describe the solution you'd like Update spring-server to bundle GraphiQL instead of Playground.

    Describe alternatives you've considered Since it is just including an extra HTML file we could potentially ship with both.

    Additional context Playground status

    type: enhancement 
    opened by dariuszkuc 0
Releases(6.3.3)
  • 6.3.3(Dec 19, 2022)

  • 6.3.2(Dec 8, 2022)

  • 6.3.1(Dec 6, 2022)

  • 7.0.0-alpha.0(Nov 10, 2022)

    Major Changes

    • [federation] default to Federation v2 (#1585) @dariuszkuc
    • feat: remove usage of GraphQLContext interface (#1580) @samuelAndalon
    • feat: CompletableFuture in FederatedTypeResolver, standardize entities resolver with other subgraph implementations (#1514) @samuelAndalon

    Minor Changes

    • [federation] add support for Fed 2.1 (#1591) @dariuszkuc
    • Configure client generate parser options (#1586) @mgilbey
    • [client] update Jackson client to always annotate input fields (#1579) @dariuszkuc
    • feat: graphQL errors per federated type element in batch (#1568) @samuelAndalon
    • feat: DataFetchingEnvironment extensions to access to entries in GraphQLContext (#1552) @samuelAndalon

    Patch Changes

    • [federation] fix fed2 link imports (#1595) @dariuszkuc
    • [federation] remove unnecessary extends on Fed 2 Query (#1590) @dariuszkuc
    • [federation] fix @link definition and doc cleanup (#1588) @dariuszkuc
    • [build] update other references of springboot version (#1584) @samuelAndalon
    • [federation] cleanup validation rules (#1581) @dariuszkuc
    • update spring-boot to 2.7.5 (#1582) @tapaderster
    • ISSUE-1566: Relax federated type validation rules (#1571) @hchen
    • [federation] deprecate @extends directive (#1562) @dariuszkuc
    • [federation] fix override directive definition (#1555) @dariuszkuc
    • [federation] rename _FieldSet to FieldSet in Federation v2 (#1547) @dariuszkuc

    Other Changes

    • [federation] update federation example and enable tests (#1599) @dariuszkuc
    • [build] use reusable workflows to simplify actions (#1598) @dariuszkuc
    • [examples] Remove unrecognized JVM option (#1577) @smyrick
    • [build] update to kotlin 1.7.10 (#1572) @samuelAndalon
    • [docs] custom scalars & optional/nullable types (#1574) @brycatch
    • chore: update instrumentation documentation (#1559) @samuelAndalon
    • [docs] update current version label to 7.x.x (#1551) @samuelAndalon
    • start 7.x.x development (#1550) @samuelAndalon

    New Contributors

    • @brycatch made their first contribution in https://github.com/ExpediaGroup/graphql-kotlin/pull/1574
    • @hchen made their first contribution in https://github.com/ExpediaGroup/graphql-kotlin/pull/1571
    Source code(tar.gz)
    Source code(zip)
  • 6.3.0(Nov 9, 2022)

    IMPORTANT: This release fixes Federation v2 support. Earlier versions DO NOT generate valid Federation 2 schema and may fail composition. Federation v1 support was not impacted.

    Minor Changes

    • Configure client generate parser options (#1586) @mgilbey

    Patch Changes

    • [federation] fix fed2 link directive imports and spec URL (#1593) @dariuszkuc

    Full Changelog: https://github.com/ExpediaGroup/graphql-kotlin/compare/6.2.5...6.3.0

    Source code(tar.gz)
    Source code(zip)
  • 6.2.5(Sep 16, 2022)

  • 6.2.4(Sep 15, 2022)

  • 6.2.3(Sep 13, 2022)

  • 6.2.2(Aug 25, 2022)

    Patch Changes

    • minor: Allow SpringGraphQLSubscriptionHandler to be extended (#1523) @emmanuelidi

    Other Changes

    • Make nullable parameters always optional (#1528) @xenomachina
    Source code(tar.gz)
    Source code(zip)
  • 6.2.1(Aug 18, 2022)

  • 6.2.0(Aug 16, 2022)

    Minor Changes

    • feat: support argument types without primaryConstructor (#1518) @samuelAndalon
    • Deprecate with @GraphQLDeprecated (#1505) @jmfayard

    Patch Changes

    • feat: update graphql-java 19.1 (#1519) @samuelAndalon
    • [generator] fix deserialization of enum values that have custom names (#1516) @dariuszkuc
    • feat: use additionalDirectives for schema directives (#1511) @samuelAndalon
    • feat: filter arguments that are in the input (#1508) @samuelAndalon

    Other Changes

    • [docs] update to v2.0.0 docusaurus (#1517) @dariuszkuc
    Source code(tar.gz)
    Source code(zip)
  • 6.1.0(Aug 2, 2022)

    Minor Changes

    • feat: batchLoaderContext to access to dataFetchingEnvironment (#1490) @samuelAndalon

    Patch Changes

    • [build] update to latest dependencies (#1495) @dariuszkuc
    • feat: dataloader instrumentations stop using deprecated methods (#1493) @samuelAndalon
    • Update to graphql-java 19.0 (#1491) @josephlbarnett
    • [federation] fix @key fed v2 definition (#1489) @dariuszkuc
    Source code(tar.gz)
    Source code(zip)
  • 6.0.0(Jul 27, 2022)

    🎉 GraphQL Kotlin 6.0.0!

    Automatic Coroutine Context Propagation

    graphql-kotlin-server automatically populates GraphQLContext map with appropriate coroutine scope. This scope contains coroutine context that was available when processing the incoming HTTP request and is subsequently used by all data fetchers to resolve the underlying fields. Users can customize the coroutine context by providing CoroutineContext::class entry in custom GraphQL context using GraphQLContextFactory.

    See https://github.com/ExpediaGroup/graphql-kotlin/pull/1349 for details.

    Apollo Federation v2 support

    Federation v2 is an evolution of the Federation spec to make it more powerful, flexible, and easier to adapt. While v1 and v2 schemas are similar in many ways, Federation v2 relaxes some of the constraints and adds additional capabilities.

    See https://github.com/ExpediaGroup/graphql-kotlin/pull/1459 for details.

    Update to graphql-java 18

    Adds support for applied schema directive. In previous versions, GraphQLDirective represented both a schema definition object as well as individual instances that were applied to a schema or query element. Schema generation logic was updated to continue generating GraphQLDirective schema definitions and then create a corresponding instance of GraphQLAppliedDirective that is applied to a target element.

    See https://github.com/ExpediaGroup/graphql-kotlin/pull/1393 for details.

    Batching and deduplication of data fetchers for BatchGraphQLRequests

    graphql-kotlin-server can now execute graphql queries concurrently, and because of that we added the capability to use DataLoaders for all queries being executed concurrently, we also added a new custom instrumentation that will dispatch the DataLoaderRegistry when all synchronous data fetchers where dispatched instead of doing it by level simulating what the javascript event loop does with the data loaders and solving these issues:

    1. https://github.com/graphql-java/graphql-java/discussions/2715
    2. https://github.com/graphql-java/graphql-java/issues/1198

    See https://github.com/ExpediaGroup/graphql-kotlin/pull/1419 for details. More information and examples on our docs

    Apollo Automatic Persisted Queries (APQ) support

    APQ is a technique created by Apollo to improve GraphQL network performance with zero build-time configuration by sending smaller GraphQL HTTP requests, a smaller request payload reduces bandwidth utilization and speeds up GraphQL client loading times.

    See https://github.com/ExpediaGroup/graphql-kotlin/pull/1474 for details. More information and examples on our docs

    Argument deserialization no longer relies on Jackson

    Data fetcher argument parsing logic no longer depends on Jackson. Old logic was problematic as arguments passed to data fetchers were already coerced to appropriate type by graphql-java but since Jackson was unaware of it, it was resulting in a duplicate deserialization. This caused custom scalar inputs deserialization problems.

    See https://github.com/ExpediaGroup/graphql-kotlin/pull/1379 for details.

    5.x.x Support

    Going forward we will only support the 5.x.x branch for critical security issues or urgent bug fixes.

    Feedback

    As with any open source project, we want to thank the community for using our library and providing valuable feedback and even pull requests. We will continue to support this library and use it in production at @ExpediaGroup, but the goal of the project is still to make GraphQL development easier for everyone. If you have a feature request or question, feel free to start a new discussion, create a new issue or reach out to our public Slack channel.

    GitHub has the full list of contributors since we made the 6.0.0 cut.


    Major Changes

    • [client] generate fallback/default implementation for polymorphic types (#1382) @dariuszkuc
    • [generator] avoid duplicate argument deserialization (#1379) @dariuszkuc
    • [client] kotlinx support for custom scalar optional input (#1357) @dariuszkuc
    • standardize coroutine context propagation in the execution (#1349) @dariuszkuc
    • feat: graphql-kotlin-dataloader (#1415) @samuelAndalon
    • [dependency] update to graphql-java 18 (#1393) @dariuszkuc

    Minor Changes

    • [generator] add IDValueUnboxer for correctly serializing ID value class (#1385) @dariuszkuc
    • feat: transaction batcher module (#1348) @samuelAndalon
    • [server] concurrent execution for batched queries (#1301) @samuelAndalon
    • feat: DataLoader Sync Execution Exhaustion Instrumentation (#1419) @samuelAndalon
    • feat: rename instrumentation module (#1418) @samuelAndalon
    • feat: remove transaction-batcher module (#1411) @samuelAndalon
    • feat: transaction batcher instrumentation level (#1378) @samuelAndalon
    • feat: add dataLoader instrumentation configuration to server (#1423) @samuelAndalon
    • feat: support directives with the union annotation (#1424) @bherrmann2
    • [generator] Apollo Federation v2 support (#1459) @dariuszkuc
    • [executions] do not apply data loader instrumentation if execution is a Mutation (#1468) @samuelAndalon
    • [generator] add support for schema directives (#1466) @dariuszkuc
    • [generator] add willGenerateDirective hook (#1461) @dariuszkuc
    • [executions] KotlinDataLoader to provide DataLoader (#1462) @samuelAndalon
    • feat: remove dataLoaderRegistry from GraphQLContext (#1448) @samuelAndalon
    • feat: support chained dataloaders in a single resolver (#1436) @samuelAndalon
    • Update spring-server to use FlowSubscriptionSchemaGeneratorHooks (#1479) @dariuszkuc
    • [client] support non JSON primitive scalars (#1488) @dariuszkuc

    Patch Changes

    • [build] update to latest federation-jvm (#1381) @dariuszkuc
    • [generator] apply hooks after filtering properties and functions (#1374) @dariuszkuc
    • feat: add GraphQLContext extension functions (#1369) @samuelAndalon
    • [generator] filter lambda properties (#1366) @dariuszkuc
    • [generator] support repeatable directives (#1360) @dariuszkuc
    • [generator] support input field deprecation (#1361) @dariuszkuc
    • [build] update to latest version of dependencies (#1358) @dariuszkuc
    • [generator] mark default PropertyDataFetcher as "trivial" (#1359) @dariuszkuc
    • [generator] support directive array/vararg parameters (#1431) @dariuszkuc
    • Upgrade to KotlinPoet v1.11.0, make corresponding required changes. (#1427) @bsorbo
    • fix: willAddGraphQLTypeToSchema needs annotations from field (#1437) @bherrmann2
    • [generator] fix Federation _service query definition (#1460) @dariuszkuc
    • feat: update graphql-java dataloader version (#1450) @samuelAndalon
    • chore: tests for batching and deduplication by field selection (#1449) @samuelAndalon
    • upgrade dependencies - springBoot, spring, kotlin (#1447) @tapaderster
    • Value type improvements (#1428) @rocketraman
    • use more inclusive terms (#1440) @tapaderster
    • [federation] fix service SDL to include schema @link info (#1487) @dariuszkuc

    Other Changes

    • Class name in SchemaGeneratorHooksProvider example (#1383) @ashu-dd
    • Fix typo in data-loaders.md (#1372) @matsluni
    • [docs] update information about optional arguments and default values (#1367) @dariuszkuc
    • [build] update to Gradle 7.3.3 (#1354) @dariuszkuc
    • start 6.x.x development (#1353) @dariuszkuc
    • examples/ktor-server: expose GraphQL Schema at /sdl (#1351) @jmfayard
    • Fix broken link (#1345) @jgorman-exp
    • Release drafter now supports putting "other changes" in a category (#1343) @smyrick
    • [build] update dependencies (#1413) @dariuszkuc
    • [docs] fix gradle plugin tasks example (#1406) @dariuszkuc
    • [docs] fix breaking page on Expedia logo click (#1401) @rv12kumar
    • [docs] documentation on inline value classes (#1395) @dariuszkuc
    • [docs] update to latest docusaurus (#1391) @dariuszkuc
    • [build] Optimize CI a bit (#1390) @Goooler
    • [examples] update federation gateway example to latest (#1387) @dariuszkuc
    • [docs] Update README.md (#1386) @imashnake0
    • Remove deprecated XX:MaxPermSize JVM argument from gradle properties, causing failures with Java 17 (#1425) @bsorbo
    • Fix typo in README (#1433) @viomckinney
    • [executions] Apollo Automatic Persisted Queries (APQ) support (#1474) @samuelAndalon
    • feat: publish sources for snapshots (#1483) @samuelAndalon
    • small letter case fix (#1484) @nikitakoselev
    • feat: add extensions to ExecutionInput from GraphQLRequest (#1482) @samuelAndalon
    Source code(tar.gz)
    Source code(zip)
  • 6.0.0-alpha.6(Jul 7, 2022)

    Minor Changes

    • Update spring-server to use FlowSubscriptionSchemaGeneratorHooks (#1479) @dariuszkuc

    Other Changes

    • [executions] Apollo Automatic Persisted Queries (APQ) support (#1474) @samuelAndalon
    Source code(tar.gz)
    Source code(zip)
  • 6.0.0-alpha.5(Jun 20, 2022)

    Minor Changes

    • [generator] Apollo Federation v2 support (#1459) @dariuszkuc
    • [executions] do not apply data loader instrumentation if execution is a Mutation (#1468) @samuelAndalon
    • [generator] add support for schema directives (#1466) @dariuszkuc
    • [generator] add willGenerateDirective hook (#1461) @dariuszkuc
    • [executions] KotlinDataLoader to provide DataLoader (#1462) @samuelAndalon
    • feat: remove dataLoaderRegistry from GraphQLContext (#1448) @samuelAndalon
    • feat: support chained dataloaders in a single resolver (#1436) @samuelAndalon

    Patch Changes

    • [generator] fix Federation _service query definition (#1460) @dariuszkuc
    • feat: update graphql-java dataloader version (#1450) @samuelAndalon
    • chore: tests for batching and deduplication by field selection (#1449) @samuelAndalon
    • upgrade dependencies - springBoot, spring, kotlin (#1447) @tapaderster
    • Value type improvements (#1428) @rocketraman
    • use more inclusive terms (#1440) @tapaderster
    Source code(tar.gz)
    Source code(zip)
  • 5.5.0(Jun 9, 2022)

    Other Changes

    • feat: update spring-boot version to 5.3.20 (#1458) @samuelAndalon Forcing usage of graphql-java:17.2 since spring-boot-starter-parent:2.7.0 pulls graphql-java:18 and graphql-kotlin 5.x.x is not compatible with that version, when clients using spring-boot-starter-parent:2.7.0 and graphql-kotlin 5.x.x the build will trigger a resolution error to force them to use graphql-java:17.2
    Source code(tar.gz)
    Source code(zip)
  • 5.4.1(May 11, 2022)

  • 5.4.0(May 9, 2022)

  • 6.0.0-alpha.4(May 6, 2022)

  • 6.0.0-alpha.3(May 4, 2022)

    Major Changes

    • feat(generator): avoid adding input-suffix for input-only classes (#1434) @mervyn-mccreight

    Patch Changes

    • fix: willAddGraphQLTypeToSchema needs annotations from field (#1437) @bherrmann2

    Other Changes

    • Fix typo in README (#1433) @viomckinney
    Source code(tar.gz)
    Source code(zip)
  • 6.0.0-alpha.2(Apr 26, 2022)

    Minor Changes

    • feat: add dataLoader instrumentation configuration to server (#1423) @samuelAndalon
    • feat: support directives with the union annotation (#1424) @bherrmann2

    Patch Changes

    • [generator] support directive array/vararg parameters (#1431) @dariuszkuc
    • Upgrade to KotlinPoet v1.11.0, make corresponding required changes. (#1427) @bsorbo

    Other Changes

    • Remove deprecated XX:MaxPermSize JVM argument from gradle properties, causing failures with Java 17 (#1425) @bsorbo
    Source code(tar.gz)
    Source code(zip)
  • 6.0.0-alpha.1(Apr 15, 2022)

    Major Changes

    • feat: graphql-kotlin-dataloader (#1415) @samuelAndalon
    • [dependency] update to graphql-java 18 (#1393) @dariuszkuc

    Minor Changes

    • feat: DataLoader Sync Execution Exhaustion Instrumentation (#1419) @samuelAndalon
    • feat: rename instrumentation module (#1418) @samuelAndalon
    • feat: remove transaction-batcher module (#1411) @samuelAndalon
    • feat: transaction batcher instrumentation level (#1378) @samuelAndalon

    Other Changes

    • [build] update dependencies (#1413) @dariuszkuc
    • [docs] fix gradle plugin tasks example (#1406) @dariuszkuc
    • [docs] fix breaking page on Expedia logo click (#1401) @rv12kumar
    • [docs] documentation on inline value classes (#1395) @dariuszkuc
    • [docs] update to latest docusaurus (#1391) @dariuszkuc
    • [build] Optimize CI a bit (#1390) @Goooler
    • [examples] update federation gateway example to latest (#1387) @dariuszkuc
    • [docs] Update README.md (#1386) @imashnake0
    Source code(tar.gz)
    Source code(zip)
  • 6.0.0-alpha.0(Mar 9, 2022)

    Major Changes

    • [client] generate fallback/default implementation for polymorphic types (#1382) @dariuszkuc
    • [generator] avoid duplicate argument deserialization (#1379) @dariuszkuc
    • [client] kotlinx support for custom scalar optional input (#1357) @dariuszkuc
    • standardize coroutine context propagation in the execution (#1349) @dariuszkuc

    Minor Changes

    • [generator] add IDValueUnboxer for correctly serializing ID value class (#1385) @dariuszkuc
    • feat: transaction batcher module (#1348) @samuelAndalon
    • [server] concurrent execution for batched queries (#1301) @samuelAndalon

    Patch Changes

    • [build] update to latest federation-jvm (#1381) @dariuszkuc
    • [generator] apply hooks after filtering properties and functions (#1374) @dariuszkuc
    • feat: add GraphQLContext extension functions (#1369) @samuelAndalon
    • [generator] filter lambda properties (#1366) @dariuszkuc
    • [generator] support repeatable directives (#1360) @dariuszkuc
    • [generator] support input field deprecation (#1361) @dariuszkuc
    • [build] update to latest version of dependencies (#1358) @dariuszkuc
    • [generator] mark default PropertyDataFetcher as "trivial" (#1359) @dariuszkuc

    Other Changes

    • Class name in SchemaGeneratorHooksProvider example (#1383) @ashu-dd
    • Fix typo in data-loaders.md (#1372) @matsluni
    • [docs] update information about optional arguments and default values (#1367) @dariuszkuc
    • [build] update to Gradle 7.3.3 (#1354) @dariuszkuc
    • start 6.x.x development (#1353) @dariuszkuc
    • examples/ktor-server: expose GraphQL Schema at /sdl (#1351) @jmfayard
    • Fix broken link (#1345) @jgorman-exp
    • Release drafter now supports putting "other changes" in a category (#1343) @smyrick
    Source code(tar.gz)
    Source code(zip)
  • 5.3.2(Jan 14, 2022)

    Patch Changes

    • [client] support @include and @skip directives (#1341) @FidasL
    • Updated schema generator to support return DataFetcherResult of list of DataFetcherResult (#1338) @dryan-cais

    Non-version Changes

    • [docs] fix readme links for client generator (#1342) @dariuszkuc
    • Documentation: update spring server link in the "Exceptions and partial data" page (#1325) @martinbonnin

    New Contributors

    • @martinbonnin made their first contribution in https://github.com/ExpediaGroup/graphql-kotlin/pull/1325
    • @dryan-cais made their first contribution in https://github.com/ExpediaGroup/graphql-kotlin/pull/1338
    • @FidasL made their first contribution in https://github.com/ExpediaGroup/graphql-kotlin/pull/1341

    Full Changelog: https://github.com/ExpediaGroup/graphql-kotlin/compare/5.3.1...5.3.2

    Source code(tar.gz)
    Source code(zip)
  • 5.3.1(Dec 9, 2021)

    Patch Changes

    • [generator] add runtime warning on deprecated context usage (#1323) @jbrwn
    • [federation] fix non-federated schema SDL (#1322) @dariuszkuc
    Source code(tar.gz)
    Source code(zip)
  • 5.3.0(Dec 2, 2021)

    Minor Changes

    • Custom types with annotation (#1298) @smyrick

    Patch Changes

    • [dependencies] downgrade to graphql-java 17.2 (#1317) @dariuszkuc
    • [client] support optional scalar input (#1284) @dariuszkuc
    • Upgrade classgraph to 4.2.131 (#1299) @xenomachina

    Non-version Changes

    • Update graphql-request-parser.md (#1302) @JonForest
    • Add example which requires an external array (#1295) @smyrick
    Source code(tar.gz)
    Source code(zip)
  • 5.2.0(Oct 28, 2021)

    Minor Changes

    • Support creating the new context map (#1292) @smyrick

    Non-version Changes

    • Update playground link (#1286) @smyrick
    • Update graphql-context-factory.md (#1279) @JonForest

    Full Changelog: https://github.com/ExpediaGroup/graphql-kotlin/compare/5.1.1...5.2.0

    Source code(tar.gz)
    Source code(zip)
  • 5.1.1(Oct 12, 2021)

  • 5.1.0(Oct 8, 2021)

    Breaking Changes

    • [client] fix handling of custom scalar inputs (#1266) @dariuszkuc
      • From 5.0.0 we had to merge this breaking change to resolve a client issue. Custom scalars are now supported as input types, however any GraphQLFloats are now mapped to Kotlin Double. Also custom scalars can not currently be wrapper with the OptionalWrapper for input [https://github.com/ExpediaGroup/graphql-kotlin/issues/1263]. They will still generate as nullables but you will not be able to explicitly set them as undefined vs null.

    Patch Changes

    • Dependency update (#1264) @smyrick

    Non-version Changes

    • [build] set target Java 8 in Gradle metadata (#1270) @dariuszkuc
    • Update scalar docs (#1265) @smyrick
    • Double is also not supported anymore (#1260) @jillesvangurp
    Source code(tar.gz)
    Source code(zip)
  • 5.0.0(Sep 29, 2021)

    ⚠️ Do Not Use ⚠️

    There are critical issues that we did not catch in our pre-release process that will require a breaking change. We are quickly working on the next version 5.1.0 which will be the recommended version of v5 to start with.

    • https://github.com/ExpediaGroup/graphql-kotlin/issues/1263
    • https://github.com/ExpediaGroup/graphql-kotlin/issues/1269

    Change Highlights

    Most of the changes are around graphql-kotlin-client. There were some minor improvements to various helper functions. We have updated to the latest version of graphql-java

    • Clients now have a simplified way of handling custom scalars (#1215)
    • [generator] remove extended scalars (#1171)
    • pass code registry to all directive environments (#1159)
    • [dependency] update to GraphQL Java 17 (#1236)

    Previous Pre-Releases

    • https://github.com/ExpediaGroup/graphql-kotlin/releases/tag/5.0.0-alpha.4
    • https://github.com/ExpediaGroup/graphql-kotlin/releases/tag/5.0.0-alpha.3
    • https://github.com/ExpediaGroup/graphql-kotlin/releases/tag/5.0.0-alpha.2
    • https://github.com/ExpediaGroup/graphql-kotlin/releases/tag/5.0.0-alpha.1
    • https://github.com/ExpediaGroup/graphql-kotlin/releases/tag/5.0.0-alpha.0

    Non-version Changes

    • Test scalar converters with Ulocale (#1259) @smyrick
    Source code(tar.gz)
    Source code(zip)
GraphQL Jetpack - A collection of packages for easily writing Java GraphQL server implementations

GraphQL Jetpack A collection of packages for easily writing Java GraphQL server

Ryan Yang 18 Dec 2, 2022
Victor Hugo 1 Feb 2, 2022
A sample skeleton backend app built using Spring Boot kotlin, Expedia Kotlin Graphql, Reactive Web that can be deployed to Google App Engine Flexible environmennt

spring-kotlin-gql-gae This is a sample skeleton of a backend app that was built using: Spring Boot(Kotlin) Reactive Web Sprinng Data R2DBC with MYSQL

Dario Mungoi 7 Sep 17, 2022
Kotlin dropwizard app running on Java 11. With Guice injection loaded.

hello world How to start the hello world application Run mvn clean install to build your application Start application with java -jar target/dropwizar

null 0 Nov 24, 2021
Kotlin backend based on the Clean Architecture principles. Ktor, JWT, Exposed, Flyway, KGraphQL/GraphQL generated endpoints, Gradle.

Kotlin Clean Architecture Backend Kotlin backend based on the Clean Architecture principles. The application is separated into three modules: Domain,

null 255 Jan 3, 2023
🗼 yukata (浴衣) is a modernized and fast GraphQL implementation made in Kotlin

?? yukata 浴衣 - Modernized and fast implementation of GraphQL made in Kotlin yukata is never meant to be captialised, so it'll just be yukata if you me

Noel 5 Nov 4, 2022
An application that simulate the Swedish Transport Agency, implemented with Spring Boot, Kotlin and GraphQL

graphql-kotlin-spring-server An application that simulate the Swedish Transport Agency, implemented with Spring Boot, Kotlin and GraphQL Running the s

null 0 Oct 31, 2021
A simple reference example Kotlin GraphQL service

A simple reference example Kotlin GraphQL service, written for colleagues coming over from Python & FastAPI/Flask + Ariadne/Graphene.

Dan Pozmanter 5 Mar 20, 2022
Simulate the running route of each player on the playground, and can be timed with a stopwatch

PathView (Simulate the running route of each player on the playground, and can be timed with a stopwatch) Generally speaking, high frequency and dense

Old Driver 5 Jun 11, 2022
Running Axon Server in Testcontainers tests.

Axon Server TestContainer Running axon server in testcontainers tests. Idea Run an Axon Server docker container from within your (junit) tests. Usage

holixon 3 Nov 21, 2022
Learn how to make an app designed for single-screen devices shine when running on foldable and dual-screen devices

dcberlin21-workshop Make your app shine om foldable devices with the samples we have here. Related links SDK open-source code SDK samples (Kotlin) App

Cesar Valiente 3 Oct 26, 2021
GraphQL for Java with Spring Boot made easy.

GraphQL for Java with Spring Boot made easy.

Netflix, Inc. 2.5k Jan 9, 2023
This repository demonstrates Spring GraphQL + RSocket + WebFlux + R2DBC + H2

Reactive GraphQL with Spring This repository demonstrates Spring GraphQL + RSocket + WebFlux + R2DBC + H2 O__ +-----------+

Maksim Kostromin 1 Nov 27, 2021
PeopleInSpace GraphQL Server

PeopleInSpace GraphQL Server GraphQL backend allowing querying list of people in

John O'Reilly 5 Oct 4, 2022
Template to accelerate the creation of new apps using Spring Boot 3, MongoDB & GraphQL.

Template to accelerate the creation of new apps using Spring Boot 3, MongoDB & GraphQL.

André Ramon 1 Feb 13, 2022
Koltin Multplatform Project that interacts with a GraphQL server to display golf scores, player and weather information.

GolfScoresKMM Koltin Multplatform Project that interacts with a GraphQL server to display golf scores, player and weather information. The app is setu

Mohit 15 Oct 21, 2022
Mock up social media android application created to interact with a backend Java server using GraphQL.

The Community Board Project Authorship: author: dnglokpor date: may 2022 Project Summary: The Community Board Project consists of a Java Spring Boot b

Delwys Glokpor 1 May 17, 2022
This is a template to help you get started building amazing Kotlin applications and libraries.

Welcome to the Starter This is a template to help you get started building amazing Kotlin applications and libraries. Over time, examples will be comp

Backbone 8 Nov 4, 2022
Create libraries for all types of Kotlin projects: android, JVM, Multiplatform, Gradle plugins, and so on.

JavierSC Kotlin template Create libraries for all types of Kotlin projects: android, JVM, Multiplatform, Gradle plugins, and so on. Features Easy to p

Javier Segovia Córdoba 2 Dec 14, 2022