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

Lombok + SPQR #87

Open
nautilor opened this issue Jul 15, 2020 · 1 comment
Open

Lombok + SPQR #87

nautilor opened this issue Jul 15, 2020 · 1 comment

Comments

@nautilor
Copy link

nautilor commented Jul 15, 2020

Hello,

I am trying to achieve something like this

 @Builder
 @NoArgsConstructor
 @AllArgsConstructor
 @EqualsAndHashCode
 @Data
 public class User {

     private String username;

     private String firstName;

     private String lastName;

     @GraphQLQuery(name = "emailAddress", description = "The user email")
     private String email;

 }

I know spqr cannot access private fields and I would have to generate getters to acheive this but I was wondering if there was a way to do this and still benefit of lombok @Data

I have found

 @Getter(onMethod = @__(@GraphQLQuery(name = "emailAddress", description = "The user email")))
 private String email;

this does work still not quite clean In my opinion

@pnboot
Copy link

pnboot commented Jul 22, 2020

@nautilor
add
@Setter
@getter

like this :

@Data
@Setter
@Getter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Person {

    @Id
    @GeneratedValue
    @Type(type = "uuid-char")
    private UUID id;

    private String name;

    @GraphQLQuery(name = "years", description = "The person age")
    private Integer age;

}

image

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

No branches or pull requests

2 participants