Closed woskaangel closed 2 years ago
This is expected behavior. Codegen needs to be told what type to map the scalar to. So you need to add a type mapping for for scalar to the enum class you are using to map it to: https://netflix.github.io/dgs/generating-code-from-schema/#mapping-existing-types
Thanks. I solved this problem.
I added this code to build.gradle.kts
@OptIn(kotlin.ExperimentalStdlibApi::class)
tasks.withType<com.netflix.graphql.dgs.codegen.gradle.GenerateJavaTask> {
typeMapping = mutableMapOf(
"SexType" to "co.test.enums.SexType",
"SignConnectionType" to "co.test.enums.SignConnectionType"
)
}
SexType.kt
SexTypeScalar.kt
schema.graphqls
generated code: SignUpInput.kt
SexType has an error. 'Unresolved reference: SexType'. However, DateTime has no errors.