Arguments on aliases
hhocine opened this issue · 0 comments
hhocine commented
Hi, I'm trying to send a request on a model where I have at the same level two same nodes with identical names and arguments. So I used alias graphQLPropertyName. Problem is I cannot inject the arguments on request. In the given example I want to do:
GraphQLTemplate graphQLTemplate = new GraphQLTemplate();
GraphQLRequestEntity requestEntity = GraphQLRequestEntity.Builder()
.url("http://graphql.example.com/graphql");
.variables(new Variable("timeFormat", "MM/dd/yyyy"))
.arguments(new Arguments("path.to.argument.property",
new Argument("id", "toto")))
.arguments(new Arguments("path.to.argument.propertyWithDifferentAlias",
new Argument("id", "titi")))
.request(SampleModel.class)
.build();
GraphQLResponseEntity<SampleModel> responseEntity = graphQLTemplate.query(requestEntity, SampleModel.class);
However the API does not validate my query (while it has the proper syntax). Here is a simplified error message:
Unrecognized field "propertyWithDifferentAlias" (class SampleModel), not marked as ignorable ( known properties: "property])
How can I inject "id" "titi" to my aliased property?