@Test public void processRequestWithoutVariables_shouldExecuteProcess() { val request = new LinkedHashMap<String, Object>(); request.put("query", "dummy"); request.put("operationName", "dummy"); val result = graphQlExecutor.executeRequest(request); assertThat(result).isNotNull(); }
@Override public Object executeRequest(Map requestBody) { val query = (String) requestBody.get("query"); val operationName = (String) requestBody.get("operationName"); val variables = getVariablesFromRequest(requestBody); val context = new HashMap<String, Object>(); beforeExecuteRequest(query, operationName, context, variables); val executionResult = graphQL.execute(query, operationName, context, variables); val result = new LinkedHashMap<String, Object>(); if (executionResult.getErrors().size() > 0) { result.put("errors", executionResult.getErrors()); log.error("Errors: {}", executionResult.getErrors()); } result.put("data", executionResult.getData()); return result; }
GraphQlExecutorImpl implements GraphQlExecutor { @Override public Object executeRequest(Map requestBody) { val query = (String) requestBody.get("query"); val operationName = (String) requestBody.get("operationName"); val variables = getVariablesFromRequest(requestBody); val context = new HashMap<String, Object>(); beforeExecuteRequest(query, operationName, context, variables); val executionResult = graphQL.execute(query, operationName, context, variables); val result = new LinkedHashMap<String, Object>(); if (executionResult.getErrors().size() > 0) { result.put("errors", executionResult.getErrors()); log.error("Errors: {}", executionResult.getErrors()); } result.put("data", executionResult.getData()); return result; } }
GraphQlExecutorImpl implements GraphQlExecutor { @Override public Object executeRequest(Map requestBody) { val query = (String) requestBody.get("query"); val operationName = (String) requestBody.get("operationName"); val variables = getVariablesFromRequest(requestBody); val context = new HashMap<String, Object>(); beforeExecuteRequest(query, operationName, context, variables); val executionResult = graphQL.execute(query, operationName, context, variables); val result = new LinkedHashMap<String, Object>(); if (executionResult.getErrors().size() > 0) { result.put("errors", executionResult.getErrors()); log.error("Errors: {}", executionResult.getErrors()); } result.put("data", executionResult.getData()); return result; }  }
GraphQlExecutorImpl implements GraphQlExecutor { @Override public Object executeRequest(Map requestBody) { val query = (String) requestBody.get("query"); val operationName = (String) requestBody.get("operationName"); val variables = getVariablesFromRequest(requestBody); val context = new HashMap<String, Object>(); beforeExecuteRequest(query, operationName, context, variables); val executionResult = graphQL.execute(query, operationName, context, variables); val result = new LinkedHashMap<String, Object>(); if (executionResult.getErrors().size() > 0) { result.put("errors", executionResult.getErrors()); log.error("Errors: {}", executionResult.getErrors()); } result.put("data", executionResult.getData()); return result; }  @Override Object executeRequest(Map requestBody); }
GraphQlExecutorImpl implements GraphQlExecutor { @Override public Object executeRequest(Map requestBody) { val query = (String) requestBody.get("query"); val operationName = (String) requestBody.get("operationName"); val variables = getVariablesFromRequest(requestBody); val context = new HashMap<String, Object>(); beforeExecuteRequest(query, operationName, context, variables); val executionResult = graphQL.execute(query, operationName, context, variables); val result = new LinkedHashMap<String, Object>(); if (executionResult.getErrors().size() > 0) { result.put("errors", executionResult.getErrors()); log.error("Errors: {}", executionResult.getErrors()); } result.put("data", executionResult.getData()); return result; }  @Override Object executeRequest(Map requestBody);  }