You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GraphQL Kotlin provides a set of lightweight type-safe GraphQL HTTP clients. The library provides Ktor HTTP client and Spring WebClient based reference implementations as well as allows for custom implementations using other engines. Type-safe data models are generated at build time by the GraphQL Kotlin Gradle and Maven plugins.
8
+
GraphQL Kotlin provides a set of lightweight type-safe GraphQL HTTP clients. The library provides Ktor HTTP client and Spring WebClient based reference implementations as well as allows for custom implementations using other engines. Jackson and kotlinx-serialization type-safe data models are generated at build time by the provided Gradle and Maven plugins.
9
9
10
-
To generate Ktor based GraphQL client add following to your Gradle build file:
10
+
To generate Jackson models that will be used with GraphQL Kotlin Spring WebClient, add following to your Gradle build file:
By default, GraphQL Kotlin plugin will look for query files under `src/main/resources`. Given `helloWorld: String!` query we can add following `HelloWorldQuery.graphql` sample query to our repo:
34
+
By default, GraphQL Kotlin plugins will look for query files under `src/main/resources`. Given `HelloWorldQuery.graphql` sample query:
37
35
38
36
```graphql
39
37
queryHelloWorldQuery {
40
38
helloWorld
41
39
}
42
40
```
43
41
44
-
Plugin will generate following client code:
42
+
Plugin will generate classes that are simple POJOs implementing GraphQLClientRequest interface and represent a GraphQL request.
0 commit comments