I have this kotlin value class:
@JvmInline
value class UserId(val id: UUID)
And I’m trying to build a Netflix DGS scalar for it but the codegen isn’t importing the class. I have written the scalar class and annotated it:
@DgsScalar(name="UserId")
class UserIdScalar: Coercing<UserId, String> { ... }
And added the typeMapping
:
tasks.withType<com.netflix.graphql.dgs.codegen.gradle.GenerateJavaTask> {
generateClient = true
packageName = "com.example.demo.generated"
typeMapping = mutableMapOf(
"UserId" to "com.example.demo.UserId"
)
}
But the generated code still has Unresolved reference: UserId
errors. Really scratching my head, this sort of thing seems to work in other projects I have.