use std::path::PathBuf;
fn get_repo_root() -> PathBuf {
let repo_root = std::process::Command::new("git")
.args(["rev-parse", "--show-toplevel"])
.output()
.unwrap()
.stdout;
let repo_root = String::from_utf8(repo_root).unwrap();
let repo_root = repo_root.trim().to_owned();
PathBuf::from(repo_root)
}
fn main() {
let repo_root = get_repo_root();
let sdl_file = repo_root.join("github_schema/github.graphql");
cynic_codegen::register_schema("github")
.from_sdl_file(&sdl_file)
.unwrap()
.as_default()
.unwrap();
}