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

Client projection of a field with arguments does not return correct projection #644

Open
TLmaK0 opened this issue Jan 13, 2024 · 1 comment

Comments

@TLmaK0
Copy link

TLmaK0 commented Jan 13, 2024

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;
  }
}
@srinivasankavitha
Copy link
Contributor

Thanks for reporting, we will look into a fix for this issue.

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