-
-
Notifications
You must be signed in to change notification settings - Fork 114
Closed
Labels
breaking-changeBreaking changeBreaking changeenhancementNew feature or requestNew feature or request
Milestone
Description
Thank you for the library, it's great! 👏
Is your feature request related to a problem? Please describe.
Because the query resolvers return the nullable object (without wrapping it in Optional) it can feel outdated for people heavily using Java8+ features.
Describe the solution you'd like
Currently when you have a query that has a nullable return type like this:
type Query {
user(id: ID!): User
}the generated code is:
@Override
public User user(final String id) {
return null;
}Would be nice to have a flag to enable/disable behaviour that allows the generation for nullable return types to use Optional instead which can make it easier to write neater code in the resolver.
@Override
public Optional<User> user(final String id) {
return Optional.empty();
}Describe alternatives you've considered
None
Additional context
None
jxnu-liguobin and kobylynskyi
Metadata
Metadata
Assignees
Labels
breaking-changeBreaking changeBreaking changeenhancementNew feature or requestNew feature or request