how to pass lookuptype! enum while using GraphQLTemplate in java

Viewed 56

I need to form a query like below -

query ($code: String!) { items(value: $code, type: "APEX") { slno alternateIdentifiers { pnno
} } }

I am using io.aexp.nodes.graphql:nodes:0.5.0 as gradle dependency

GraphQLRequestEntity requestEntity = GraphQLRequestEntity.Builder()
                .url("https://api.xxx.com/xxxxx/v1/graphql")
                .arguments(new Arguments("items",new Argument("type", "APEX")),new Arguments("items",new Argument("code", codeVal)))
                .request(MyRequestObject.class)
                .headers(keyMap)
                .build();
        GraphQLResponseEntity<MyRequestObject> responseEntity = graphQLTemplate.query(requestEntity, MyRequestObject.class);

I am able to pass the argument code with the required value but not able to find a way to pass the lookuptype! enum type as APEX. If I pass this as argument it it results into the below query

query { items (code:"829576918867",type:"APEX") { slno alternateIdentifiers { pnno } } } 

so the type is getting passed as a string and not enum. and getting error -

Validation error of type WrongType: argument 'type' with value 'StringValue{value='APEX'}'

Any help in this regard will be highly appreciated. TIA.

0 Answers
Related