Skip to content

Commit

Permalink
GraphQL DGS Code Generation
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-adam committed Apr 4, 2024
1 parent 74d3a14 commit 4ba8162
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ These additional references should also help you:
* [Gradle Build Scans – insights for your project's build](https://scans.gradle.com#gradle)
* [Configure AOT settings in Build Plugin](https://docs.spring.io/spring-boot/docs/3.2.4/gradle-plugin/reference/htmlsingle/#aot)

## GraphQL code generation with DGS

This project has been configured to use the Netflix DGS Codegen plugin.
This plugin can be used to generate client files for accessing remote GraphQL services.
The default setup assumes that the GraphQL schema file for the remote service is added to the `src/main/resources/graphql-client/` location.

You can learn more about the [plugin configuration options](https://netflix.github.io/dgs/generating-code-from-schema/#configuring-code-generation) and
[how to use the generated types](https://netflix.github.io/dgs/generating-code-from-schema/) to adapt the default setup.


## GraalVM Native Support

This project has been configured to let you generate either a lightweight container or a native executable.
Expand Down
8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot") version "3.2.4"
id("io.spring.dependency-management") version "1.1.4"
id("com.netflix.dgs.codegen") version "6.0.3"
id("org.graalvm.buildtools.native") version "0.9.28"
kotlin("jvm") version "1.9.23"
kotlin("plugin.spring") version "1.9.23"
Expand Down Expand Up @@ -35,3 +36,10 @@ tasks.withType<KotlinCompile> {
tasks.withType<Test> {
useJUnitPlatform()
}

tasks.generateJava {
schemaPaths.add("${projectDir}/src/main/resources/graphql-client")
packageName = "pl.writeonly.omnibus.codegen"
generateClient = true
}

0 comments on commit 4ba8162

Please sign in to comment.