dgs-codegen
dgs-codegen copied to clipboard
Client projection of a field with arguments does not return correct projection
In versions 6.x when you create a schema like this:
type Query {
request: Response
}
type Foobar {
foo(first: Int): String
}
type Response {
bar: Foobar
}
Field foo(Integer first) returns FieldObjectProjection instead of FieldObjectProjection<PARENT, ROOT>.
public class FoobarProjection<PARENT extends BaseSubProjectionNode<?, ?>, ROOT extends BaseSubProjectionNode<?, ?>> extends BaseSubProjectionNode<PARENT, ROOT> {
public FoobarProjection(PARENT parent, ROOT root) {
super(parent, root, java.util.Optional.of("Foobar"));
}
public FoobarProjection<PARENT, ROOT> foo() {
getFields().put("foo", null);
return this;
}
public FoobarProjection foo(Integer first) {
getFields().put("foo", null);
getInputArguments().computeIfAbsent("foo", k -> new ArrayList<>());
InputArgument firstArg = new InputArgument("first", first);
getInputArguments().get("foo").add(firstArg);
return this;
}
}
Thanks for reporting, we will look into a fix for this issue.