Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
romash1408 opened this issue Dec 2, 2022 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@romash1408
Copy link
Contributor

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
@romash1408 romash1408 added the bug Something isn't working label Dec 2, 2022
romash1408 pushed a commit to romash1408/graphql-java-codegen that referenced this issue Dec 2, 2022
romash1408 pushed a commit to romash1408/graphql-java-codegen that referenced this issue Dec 2, 2022
romash1408 pushed a commit to romash1408/graphql-java-codegen that referenced this issue Dec 3, 2022
romash1408 pushed a commit to romash1408/graphql-java-codegen that referenced this issue Dec 3, 2022
@kobylynskyi kobylynskyi added this to the 5.6.0 milestone Feb 26, 2023
kobylynskyi added a commit that referenced this issue Feb 26, 2023
…1019 (#1020)

---------

Co-authored-by: romash1408 <romash1408@gmail.com>
Co-authored-by: Bogdan Kobylynskyi <92bogdan@gmail.com>
@kobylynskyi
Copy link
Owner

Thanks @romash1408 for the contribution. I will include your change in the upcoming release. Stay tuned.

kobylynskyi added a commit that referenced this issue Feb 28, 2023
…1019 (#1020)

---------

Co-authored-by: romash1408 <romash1408@gmail.com>
Co-authored-by: Bogdan Kobylynskyi <92bogdan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants