I'm a novice to GraphQL. Currently I'm trying to generate a GraphQL client with Netflix's DGS framework. I used the schema of SWAPI as my Domain Graph Service’s GraphQL schema file. But the tool only generates only the Classes and Interfaces related to types. But do not generate the query API as expected. This is my build.gradle file
plugins {
id 'org.springframework.boot' version '2.5.5'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id("com.netflix.dgs.codegen") version "5.1.2"
}
group = 'com.clients.netflix'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web:2.5.5'
developmentOnly 'org.springframework.boot:spring-boot-devtools:2.5.5'
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.5.5'
implementation 'com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter:4.8.3'
}
test {
useJUnitPlatform()
}
generateJava {
generateClient = true
generateDataTypes = true
}
Is there a correct way to do this or is it a problem in the framework?
That is the correct behavior. As you can read in the documentation the generator generates exmaple APIs!
DOC
The generator does not know how you want to fetch data from your DB or what ever.
If you want to generate the examples you must add