Skip to content

Resolver with customly mapped return type loses kotlin nullability when apiReturnType is used #1019

@romash1408

Description

@romash1408

Steps to Reproduce

config

    generatedLanguage = GeneratedLanguage.KOTLIN
    generateApis = true
    apiReturnType = "reactor.core.publisher.Mono"
    customTypesMapping = mapOf(
        "ZonedDateTime" to "String",
    )

schema

type Query {
    nullable: ZonedDateTime
    mandatory: ZonedDateTime!
}

Expected Result

interface QueryResolver {

    @Throws(Exception::class)
    fun nullable(): reactor.core.publisher.Mono<String?>

    @Throws(Exception::class)
    fun mandatory(): reactor.core.publisher.Mono<String>

}

Actual Result

interface QueryResolver {

    @Throws(Exception::class)
    fun nullable(): reactor.core.publisher.Mono<String>

    @Throws(Exception::class)
    fun mandatory(): reactor.core.publisher.Mono<String>

}

non nullable return type of nullable() doesn't match the schema

Your Environment and Setup

  • graphql-java-codegen version: 5.5.0
  • Build tool: Gradle

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions