Skip to content

Commit 87b0acd

Browse files
committed
Update dependencies and examples, bump to 0.2
1 parent bcf7e7f commit 87b0acd

File tree

8 files changed

+31
-11
lines changed

8 files changed

+31
-11
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "graphql_client"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
authors = ["Tom Houlé <[email protected]>"]
55
description = "Typed GraphQL requests and responses"
66
repository = "https://github.com/tomhoule/graphql-client"
@@ -11,7 +11,7 @@ categories = ["network-programming", "web-programming", "wasm"]
1111
[dependencies]
1212
failure = "0.1"
1313
quote = "0.3"
14-
graphql_query_derive = {path = "./graphql_query_derive", version = "0.1.0"}
14+
graphql_query_derive = {path = "./graphql_query_derive", version = "0.2.0"}
1515
graphql-parser = "0.2.0"
1616
serde = "1.0"
1717
serde_derive = "1.0"

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# graphql_client
22

33
[![Build Status](https://travis-ci.org/tomhoule/graphql-client.svg?branch=master)](https://travis-ci.org/tomhoule/graphql-client)
4-
[![docs](https://docs.rs/graphql_client/badge.svg)](https://docs.rs/graphql_client/0.1.0/graphql_client/)
4+
[![docs](https://docs.rs/graphql_client/badge.svg)](https://docs.rs/graphql_client/0.2.0/graphql_client/)
55
[![crates.io](https://img.shields.io/crates/v/graphql_client.svg)](https://crates.io/crates/graphql_client)
66

77
A typed GraphQL client library for Rust.
@@ -12,6 +12,7 @@ A typed GraphQL client library for Rust.
1212
- Supports GraphQL fragments, objects, unions, inputs, enums, custom scalars and input objects
1313
- Works in the browser (WebAssembly)
1414
- Subscriptions support (serialization-deserialization only at the moment)
15+
- Copies documentation from the GraphQL schema to the generated Rust code
1516

1617
## Getting started
1718

examples/call_from_js/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ lto = "thin"
1010
crate-type = ["cdylib"]
1111

1212
[dependencies]
13-
graphql_client = { path = "../..", version = "0.1.0" }
14-
wasm-bindgen = "0.2.11"
13+
graphql_client = { path = "../..", version = "0.2.0" }
14+
wasm-bindgen = "0.2.12"
1515
serde = "1.0.67"
1616
serde_derive = "1.0.67"
1717
serde_json = "1.0.22"

examples/call_from_js/src/lib.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(proc_macro, wasm_custom_section, wasm_import_module)]
1+
#![feature(wasm_custom_section, wasm_import_module, use_extern_macros)]
22

33
#[macro_use]
44
extern crate graphql_client;
@@ -18,7 +18,10 @@ use wasm_bindgen::prelude::*;
1818
use graphql_client::*;
1919

2020
#[derive(GraphQLQuery)]
21-
#[graphql(schema_path = "schema.json", query_path = "src/puppy_smiles.graphql")]
21+
#[graphql(
22+
schema_path = "schema.json",
23+
query_path = "src/puppy_smiles.graphql"
24+
)]
2225
struct PuppySmiles;
2326

2427
#[wasm_bindgen]

examples/github/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ prettytable-rs = "0.7.0"
1414
structopt = "0.2.10"
1515
dotenv = "0.13.0"
1616
envy = "0.3.2"
17+
log = "0.4.3"
18+
env_logger = "0.5.10"

examples/github/src/main.rs

+14
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ extern crate envy;
44
extern crate failure;
55
#[macro_use]
66
extern crate graphql_client;
7+
#[macro_use]
8+
extern crate log;
9+
extern crate env_logger;
710
extern crate reqwest;
811
extern crate serde;
912
extern crate serde_json;
@@ -45,6 +48,7 @@ fn parse_repo_name(repo_name: &str) -> Result<(&str, &str), failure::Error> {
4548

4649
fn main() -> Result<(), failure::Error> {
4750
dotenv::dotenv().ok();
51+
env_logger::init();
4852

4953
let config: Env = envy::from_env()?;
5054

@@ -70,6 +74,16 @@ fn main() -> Result<(), failure::Error> {
7074
.send()?;
7175

7276
let response_body: GraphQLResponse<query1::ResponseData> = res.json()?;
77+
info!("{:?}", response_body);
78+
79+
if let Some(errors) = response_body.errors {
80+
println!("there are errors:");
81+
82+
for error in &errors {
83+
println!("{:?}", error);
84+
}
85+
}
86+
7387
let response_data: query1::ResponseData = response_body.data.expect("missing response data");
7488

7589
let stars: Option<i64> = response_data

graphql_client_cli/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "graphql_client_cli"
33
description = "The CLI for graphql-client (WIP)"
4-
version = "0.1.0"
4+
version = "0.2.0"
55
authors = ["Tom Houlé <[email protected]>"]
66
license = "Apache-2.0 OR MIT"
77

@@ -12,7 +12,7 @@ path = "src/main.rs"
1212
[dependencies]
1313
failure = "0.1"
1414
reqwest = "0.8"
15-
graphql_client = { version = "0.1.0", path = ".." }
15+
graphql_client = { version = "0.2.0", path = ".." }
1616
structopt = "0.2"
1717
serde = "1.0"
1818
serde_derive = "1.0"

graphql_query_derive/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "graphql_query_derive"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
authors = ["Tom Houlé <[email protected]>"]
55
description = "Utility crate for graphql_client"
66
license = "Apache-2.0 OR MIT"
@@ -13,7 +13,7 @@ proc-macro = true
1313
failure = "0.1"
1414
quote = "^0.6"
1515
syn = "0.14"
16-
proc-macro2 = { version = "0.4" }
16+
proc-macro2 = { version = "0.4", features = [] }
1717
serde = "1.0"
1818
serde_derive = "1.0"
1919
serde_json = "1.0"

0 commit comments

Comments
 (0)