-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
326 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
type URI = String; | ||
type DateTime = chrono::DateTime<chrono::Utc>; | ||
|
||
use graphql_client::GraphQLQuery; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
use self::pull_requests_query::{PullRequestsQuerySearchEdgesNode, PullRequestsQuerySearchEdgesNodeOnPullRequest}; | ||
#[derive(GraphQLQuery)] | ||
#[graphql( | ||
schema_path = "src/github/schema.graphql", | ||
query_path = "src/github/queries/pull_requests.graphql", | ||
variables_derives = "Clone, Debug", | ||
response_derives = "Clone, Debug" | ||
)] | ||
pub struct PullRequestsQuery; | ||
|
||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] | ||
pub struct PullRequest { | ||
pub number: usize, | ||
pub title: String, | ||
pub repository: String, | ||
pub created_at: DateTime, | ||
pub updated_at: DateTime, | ||
pub url: URI, | ||
pub changed_files: usize, | ||
pub additions: usize, | ||
pub deletions: usize, | ||
} | ||
|
||
impl From<&PullRequestsQuerySearchEdgesNodeOnPullRequest> for PullRequest { | ||
fn from(value: &PullRequestsQuerySearchEdgesNodeOnPullRequest) -> Self { | ||
Self { | ||
number: value.number as usize, | ||
title: value.title.clone(), | ||
repository: value.repository.name_with_owner.clone(), | ||
created_at: value.created_at, | ||
updated_at: value.updated_at, | ||
url: value.url.clone(), | ||
changed_files: value.changed_files as usize, | ||
additions: value.additions as usize, | ||
deletions: value.deletions as usize, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.