#include <cxxopts/cxxopts.hpp>
#include <iostream>
#include <libgraphql.h>
#include <string>

int main(int argc, char *argv[]) {
  cxxopts::Options options("MyCLI", "Example CLI tool");
  options.add_options()("n,name", "Your name", cxxopts::value<std::string>());

  auto result = options.parse(argc, argv);

  if (result.count("name")) {
    std::cout << "Hello, " << result["name"].as<std::string>() << "!"
              << std::endl;
  } else {
    std::cout << "Hello, World!" << std::endl;
  }

  std::string query = R"(
    query {
      hello
    }
  )";
  char *response = QueryGraphQL((char *)query.c_str());
  std::cout << response << std::endl;

  auto waitlistResponse = GetWaitlist();
  std::cout << waitlistResponse.r0 << std::endl;
  std::cout << waitlistResponse.r1 << std::endl;

  return 0;
}
