//! Definitions for GitHub GraphQL. //! //! See for more GitHub's GraphQL API. // This schema can be downloaded from https://docs.github.com/public/schema.docs.graphql pub mod queries { use super::schema; pub type Date = chrono::NaiveDate; pub type DateTime = chrono::DateTime; cynic::impl_scalar!(Date, schema::Date); cynic::impl_scalar!(DateTime, schema::DateTime); #[derive(cynic::QueryVariables, Debug, Clone)] pub struct LeastRecentlyReviewedPullRequestsArguments<'a> { pub repository_owner: &'a str, pub repository_name: &'a str, pub after: Option, } #[derive(cynic::QueryFragment, Debug)] #[cynic( graphql_type = "Query", variables = "LeastRecentlyReviewedPullRequestsArguments" )] pub struct LeastRecentlyReviewedPullRequests { #[arguments(owner: $repository_owner, name: $repository_name)] pub repository: Option, } #[derive(cynic::QueryFragment, Debug)] #[cynic(variables = "LeastRecentlyReviewedPullRequestsArguments")] pub struct Repository { #[arguments( states: "OPEN", first: 100, after: $after, labels: ["S-waiting-on-review"], orderBy: {direction: "ASC", field: "UPDATED_AT"} )] pub pull_requests: PullRequestConnection, } #[derive(cynic::QueryFragment, Debug)] pub struct PullRequestConnection { pub total_count: i32, pub page_info: PageInfo, #[cynic(flatten)] pub nodes: Vec, } #[derive(cynic::QueryFragment, Debug)] pub struct PullRequest { pub number: i32, pub created_at: DateTime, pub url: Uri, pub title: String, #[arguments(first = 100)] pub labels: Option, pub is_draft: bool, #[arguments(first = 100)] pub assignees: UserConnection, #[arguments(first = 100, orderBy: { direction: "DESC", field: "UPDATED_AT" })] pub comments: IssueCommentConnection, #[arguments(last = 20)] pub latest_reviews: Option, } #[derive(cynic::QueryFragment, Debug)] pub struct PullRequestReviewConnection { pub total_count: i32, #[cynic(flatten)] pub nodes: Vec, } #[derive(cynic::QueryFragment, Debug)] pub struct PullRequestReview { pub author: Option, pub created_at: DateTime, } #[derive(cynic::QueryFragment, Debug)] pub struct UserConnection { #[cynic(flatten)] pub nodes: Vec, } #[derive(cynic::QueryFragment, Debug)] pub struct User { pub login: String, pub database_id: Option, } #[derive(cynic::QueryFragment, Debug)] pub struct PageInfo { pub has_next_page: bool, pub end_cursor: Option, } #[derive(cynic::QueryFragment, Debug)] pub struct LabelConnection { #[cynic(flatten)] pub nodes: Vec