-
|
Hi, I seem to be having some challenging time finding documentations about coercion when passing a value of type ...
String query = """
query(
$testID: ID!
) {
testQuery(
testID: $testID
) {
...
}
}
"""
...
CustomGraphQLClient client = GraphQLClient.createCustom(clientConfig.graphQlUrl(), (url, headers, body) -> {
HttpHeaders httpHeaders = new HttpHeaders();
headers.forEach(httpHeaders::addAll);
ResponseEntity<String> exchange = restTemplate.exchange(url, HttpMethod.POST, new HttpEntity<>(
body,
httpHeaders
), String.class);
return new HttpResponse(exchange.getStatusCode().value(), exchange.getBody());
});
GraphQLResponse graphQLResponse = client.executeQuery(query, Map.of(
"$testID",
"123"
));
... |
Beta Was this translation helpful? Give feedback.
Answered by
karmingc
Mar 17, 2023
Replies: 1 comment
-
|
In order to pass the arguments to the GraphQLResponse graphQLResponse = client.executeQuery(query, Map.of(
- "$testID",
+ "testID",
"123"
)); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
karmingc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In order to pass the arguments to the
$testID, we needed to declare it astestIDinsteadref: https://graphql.org/graphql-js/passing-arguments/