Skip to content

Conversation

@kobylynskyi
Copy link
Owner

Fixes #410

@kobylynskyi kobylynskyi self-assigned this Dec 4, 2020
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 4, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

94.5% 94.5% Coverage
0.0% 0.0% Duplication

)
public interface NodeQueryResolver {

reactor.core.publisher.Mono<java.util.Optional<Node>> node(String id) throws Exception;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mono itself can describe 0 or 1 in reactor.Users of the stream should be aware of this.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right. But have you seen the bug description? There could be some types that can expect Optional as a sub-type. Anyway, this Optional thing can be disabled. That's up to the client to decide.

}
}
if (javaTypeName.startsWith(JAVA_UTIL_LIST) &&
if (computedTypeName.startsWith(JAVA_UTIL_LIST) &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can use switch ? I'm implementing kotlin, and there's going to be a lot of conflict.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jxnu-liguobin before implementing kotlin we need to refactor the code to make it simple for further extensions. I was thinking to do it later next week. So please don't do kotlin yet :)

Copy link
Collaborator

@jxnu-liguobin jxnu-liguobin Dec 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, the templates and code have been written https://github.com/jxnu-liguobin/graphql-java-codegen/tree/kotlin/src/main/resources/templates/kotlin-lang (In addition to the unit test, the rest are basically ready
), but there is still one problem that has not been solved. I am ready to wait until you refactor.

@kobylynskyi kobylynskyi merged commit f0fc966 into master Dec 5, 2020
@kobylynskyi kobylynskyi deleted the 410-optional-apireturntype branch December 5, 2020 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

useOptionalForNullableReturnTypes conflicts with apiReturnType (Version: 4.0.0)

3 participants