Skip to content

Commit 34e69d2

Browse files
authored
Merge pull request #147 from h-michael/fix-example
Fix breaking example codeArter #123
2 parents dcaf5c8 + f23af0f commit 34e69d2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/github/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type URI = String;
2828
query_path = "src/query_1.graphql",
2929
response_derives = "Debug",
3030
)]
31-
struct Query1;
31+
struct RepoView;
3232

3333
#[derive(StructOpt)]
3434
struct Command {
@@ -60,7 +60,7 @@ fn main() -> Result<(), failure::Error> {
6060
let repo = args.repo;
6161
let (owner, name) = parse_repo_name(&repo).unwrap_or(("tomhoule", "graphql-client"));
6262

63-
let q = Query1::build_query(query1::Variables {
63+
let q = RepoView::build_query(repo_view::Variables {
6464
owner: owner.to_string(),
6565
name: name.to_string(),
6666
});
@@ -73,7 +73,7 @@ fn main() -> Result<(), failure::Error> {
7373
.json(&q)
7474
.send()?;
7575

76-
let response_body: Response<query1::ResponseData> = res.json()?;
76+
let response_body: Response<repo_view::ResponseData> = res.json()?;
7777
info!("{:?}", response_body);
7878

7979
if let Some(errors) = response_body.errors {
@@ -84,7 +84,7 @@ fn main() -> Result<(), failure::Error> {
8484
}
8585
}
8686

87-
let response_data: query1::ResponseData = response_body.data.expect("missing response data");
87+
let response_data: repo_view::ResponseData = response_body.data.expect("missing response data");
8888

8989
let stars: Option<i64> = response_data
9090
.repository

0 commit comments

Comments
 (0)