josh-github-graphql 26.5.8

GitHub GraphQL client for Josh
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use anyhow::Context;

use crate::connection::GithubApiConnection;
use josh_github_codegen_graphql::{get_repo_id, GetRepoId};

impl GithubApiConnection {
    pub async fn get_repo_id(&self, owner: &str, name: &str) -> anyhow::Result<String> {
        let variables = get_repo_id::Variables {
            owner: owner.to_string(),
            name: name.to_string(),
        };

        let response = self.make_request::<GetRepoId>(variables).await?;
        Ok(response.repository.context("Empty repository field")?.id)
    }
}