-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
Describe the bug
When an abstract class with Lomboks fluent accesssors is defined, graphql.schema.PropertyFetchingImpl#getPropertyViaFieldAccess will not find the field because it does not check the superclass like e.g. graphql.schema.PropertyFetchingImpl#findPubliclyAccessibleMethod. This results in a null value in the query response for data that is acutally available.
To Reproduce
Use this schema:
type Query {
movies: [Movie]
}
interface Movie {
title: String
}
type ScaryMovie implements Movie {
title: String
gory: Boolean
scareFactor: Int
}
type ActionMovie implements Movie {
title: String
nrOfExplosions: Int
}
Implement the classes like this:
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(fluent = true)
public abstract class Movie {
private String title;
}
@Data
@Accessors(fluent = true)
public class ActionMovie extends Movie {
private int nrOfExplosions;
public ActionMovie(final String title, int nrOfExplosions) {
super(title);
this.nrOfExplosions = nrOfExplosions;
}
}
@Data
@Accessors(fluent = true)
public class ScaryMovie extends Movie {
private boolean gory;
private int scareFactor;
public ScaryMovie(final String title, final boolean gory, final int scareFactor) {
super(title);
this.gory = gory;
this.scareFactor = scareFactor;
}
}
I created a simple project to demonstrate this: https://github.com/AlexanderPraegla/graphql-java-lombok-fluent-accessor
Reactions are currently unavailable