Client projection of a field with arguments does not return correct projection
Open
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 217
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Description
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;
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the schema and generated FoobarProjection shown in the issue, then trace the projection-generation path for fields that accept arguments. Reproduce the schema case and compare the parameterized foo method with the no-argument method. Done means the generated method preserves the PARENT and ROOT generic types and a regression test covers the argument-bearing field.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kotlin
- Domain
- backend-api-design, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100