Skip to content

useOptionalForNullableReturnTypes conflicts with apiReturnType (Version: 4.0.0) #410

@dsilvasc

Description

@dsilvasc

Issue Description

If you set both useOptionalForNullableReturnTypes and apiReturnType to true, the generator ignores apiReturnType.

Steps to Reproduce

tasks.named<io.github.kobylynskyi.graphql.codegen.gradle.GraphQLCodegenGradleTask>("graphqlCodegen") {
  ...
  apiReturnType = "java.util.concurrent.CompletionStage"
  useOptionalForNullableReturnTypes = true
}

Expected Result

@javax.annotation.Generated(
    value = "com.kobylynskyi.graphql.codegen.GraphQLCodegen",
    date = "2020-11-30T13:39:15+0000"
)
public interface QueryResolver {

    java.util.concurrent.CompletionStage<java.util.Optional<Publisher>> example(String id, graphql.schema.DataFetchingEnvironment env) throws Exception;

}

Actual Result

@javax.annotation.Generated(
    value = "com.kobylynskyi.graphql.codegen.GraphQLCodegen",
    date = "2020-11-30T13:39:15+0000"
)
public interface QueryResolver {

    java.util.Optional<Publisher> example(String id, graphql.schema.DataFetchingEnvironment env) throws Exception;

}

Your Environment and Setup

  • graphql-java-codegen: 4.0.0
  • Build tool: Gradle
  • Java tool: 1.8.0_242
  • Mapping Config: see above

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions