Document variable usage
balazsmaria opened this issue · 2 comments
balazsmaria commented
Looking at GraphQLRequestBuilder.variables(Object variables) it's not entirely clear how to set variables.
balazsmaria commented
What I did was:
Map<String, String> vars = Map.of("myvar", "value");
var request = GraphQLRequest.builder()
.header(HttpHeaders.AUTHORIZATION, TOKEN)
.resource("query.graphql")
.variables(vars)
.build();
D0mc3k commented
I have used an immutable map
Map<String, Object> variables = ImmutableMap.of(key, value);