2

in my gradle file I have

plugins {
    ...
    id("com.netflix.dgs.codegen") version "5.5.0"
}
dependencies {
    ...
    implementation("com.netflix.graphql.dgs.codegen:graphql-dgs-codegen-gradle:5.5.0")
    implementation("com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter:4.9.11")
}
 
tasks.withType<com.netflix.graphql.dgs.codegen.gradle.GenerateJavaTask> {
    schemaPaths = mutableListOf("$projectDir/src/main/resources/schema")
    generateClient = true
    packageName = "com.example.api.generated"
}

in above code, the package com.netflix.graphql.dgs.codegen.gradle.GenerateJavaTask cannot be imported and used properly. I need to store generated files in generated directory. what am I missing here? search package also is not helping to find it.

enter image description here

DragonKnight
  • 1,740
  • 2
  • 22
  • 35
  • What does "cannot be imported and used properly" mean? What command are you running, and what output are you getting? – aSemy Oct 31 '22 at 06:21
  • @aSemy intellij makes is red and `GenerateJavaTask` is not available to be called. in `com.netflix.graphql.dgs.codegen.gradle.` suggestions are `CodegenPluginExtension` only and `GenerateJavaTask` is not there. – DragonKnight Oct 31 '22 at 06:34
  • What happens if you run a Gradle command from the command line? Have you tried syncing IntelliJ? https://www.jetbrains.com/idea/guide/tutorials/working-with-gradle/syncing-and-reloading/ – aSemy Oct 31 '22 at 06:37
  • @aSemy tried `./gradlew build ` and build is successful. but yet same problem. – DragonKnight Oct 31 '22 at 06:42

0 Answers0