diff --git a/crates/binstalk-git-repo-api/src/gh_api_client/common.rs b/crates/binstalk-git-repo-api/src/gh_api_client/common.rs index e8c293f3..b09823e9 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client/common.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client/common.rs @@ -1,4 +1,4 @@ -use std::{future::Future, sync::OnceLock, time::Duration}; +use std::{fmt::Debug, future::Future, sync::OnceLock, time::Duration}; use binstalk_downloader::remote::{self, Response, Url}; use compact_str::CompactString; @@ -81,7 +81,7 @@ where } } -#[derive(Deserialize)] +#[derive(Debug, Deserialize)] struct GraphQLResponse { data: T, errors: Option, @@ -109,7 +109,7 @@ pub(super) fn issue_graphql_query( auth_token: &str, ) -> impl Future> + Send + Sync + 'static where - T: DeserializeOwned, + T: DeserializeOwned + Debug, { let res = to_json_string(&GraphQLQuery { query }) .map_err(remote::Error::from) @@ -132,6 +132,8 @@ where let mut response: GraphQLResponse = response.json().await?; + debug!("response = {response:?}"); + if let Some(error) = response.errors.take() { Err(error.into()) } else { diff --git a/crates/binstalk-git-repo-api/src/gh_api_client/release_artifacts.rs b/crates/binstalk-git-repo-api/src/gh_api_client/release_artifacts.rs index 3af455ed..774f682a 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client/release_artifacts.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client/release_artifacts.rs @@ -83,30 +83,30 @@ pub(super) fn fetch_release_artifacts_restful_api( ) } -#[derive(Deserialize)] +#[derive(Debug, Deserialize)] struct GraphQLData { repository: Option, } -#[derive(Deserialize)] +#[derive(Debug, Deserialize)] struct GraphQLRepo { release: Option, } -#[derive(Deserialize)] +#[derive(Debug, Deserialize)] struct GraphQLRelease { #[serde(rename = "releaseAssets")] assets: GraphQLReleaseAssets, } -#[derive(Deserialize)] +#[derive(Debug, Deserialize)] struct GraphQLReleaseAssets { nodes: Vec, #[serde(rename = "pageInfo")] page_info: GraphQLPageInfo, } -#[derive(Deserialize)] +#[derive(Debug, Deserialize)] struct GraphQLPageInfo { #[serde(rename = "endCursor")] end_cursor: Option, diff --git a/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs b/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs index 04e4c9f8..ddc6d152 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs @@ -48,7 +48,7 @@ pub(super) fn fetch_repo_info_restful_api( issue_restful_api(client, &["repos", owner, repo]) } -#[derive(Deserialize)] +#[derive(Debug, Deserialize)] struct GraphQLData { repository: Option, }