code: private JsonArray getRecordsForQuery(SalesforceConnector connector, String query) {
      try {
        String soqlQuery = SalesforceExtractor.getSoqlUrl(query);
        List<Command> commands = RestApiConnector.constructGetCommand(connector.getFullUri(soqlQuery));
        CommandOutput<?, ?> response = connector.getResponse(commands);
  
        String output;
        Iterator<String> itr = (Iterator<String>) response.getResults().values().iterator();
        if (itr.hasNext()) {
          output = itr.next();
        } else {
          throw new DataRecordException("Failed to get data from salesforce; REST response has no output");
        }
  
        return GSON.fromJson(output, JsonObject.class).getAsJsonArray("records");
      } catch (RestApiClientException | RestApiProcessingException | DataRecordException e) {
        throw new RuntimeException("Fail to get data from salesforce", e);
      }
    }
docs: Get a {@link JsonArray} containing the query results