Search in sources :

Example 1 with QueryBuilder

use of io.smallrye.graphql.client.impl.typesafe.QueryBuilder in project smallrye-graphql by smallrye.

the class VertxTypesafeGraphQLClientProxy method request.

private JsonObject request(MethodInvocation method) {
    JsonObjectBuilder request = jsonObjectFactory.createObjectBuilder();
    String query = queryCache.computeIfAbsent(method.getKey(), key -> new QueryBuilder(method).build());
    request.add("query", query);
    request.add("variables", variables(method));
    request.add("operationName", method.getName());
    log.debugf("request graphql: %s", query);
    JsonObject result = request.build();
    log.debugf("full graphql request: %s", result.toString());
    return result;
}
Also used : JsonObject(javax.json.JsonObject) QueryBuilder(io.smallrye.graphql.client.impl.typesafe.QueryBuilder) JsonObjectBuilder(javax.json.JsonObjectBuilder)

Aggregations

QueryBuilder (io.smallrye.graphql.client.impl.typesafe.QueryBuilder)1 JsonObject (javax.json.JsonObject)1 JsonObjectBuilder (javax.json.JsonObjectBuilder)1