Skip to content

Commit 098d9ae

Browse files
committed
Rename gql attribute to graphql
For clarity
1 parent a0253cf commit 098d9ae

File tree

12 files changed

+19
-17
lines changed

12 files changed

+19
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This library does not provide any networking, caching or other client functional
1212

1313
```rust
1414
#[derive(GraphQLQuery)]
15-
#[gql(
15+
#[graphql(
1616
// The paths are relative to the directory where your `Cargo.toml` is located.
1717
query_path = "src/graphql/queries/my_query.graphql",
1818
schema_path = "src/graphql/schema.json"

examples/call_from_js/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use wasm_bindgen::prelude::*;
1818
use graphql_client::*;
1919

2020
#[derive(GraphQLQuery)]
21-
#[gql(schema_path = "schema.json", query_path = "src/puppy_smiles.graphql")]
21+
#[graphql(schema_path = "schema.json", query_path = "src/puppy_smiles.graphql")]
2222
struct PuppySmiles;
2323

2424
#[wasm_bindgen]

examples/example_module/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ extern crate serde_derive;
55
extern crate graphql_client;
66

77
#[derive(GraphQLQuery)]
8-
#[gql(schema_path = "../github/src/schema.graphql", query_path = "../github/src/query_1.graphql")]
8+
#[graphql(
9+
schema_path = "../github/src/schema.graphql", query_path = "../github/src/query_1.graphql"
10+
)]
911
pub struct ExampleModule;

examples/github/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use graphql_client::*;
1818
use structopt::StructOpt;
1919

2020
#[derive(GraphQLQuery)]
21-
#[gql(schema_path = "src/schema.graphql", query_path = "src/query_1.graphql")]
21+
#[graphql(schema_path = "src/schema.graphql", query_path = "src/query_1.graphql")]
2222
struct Query1;
2323

2424
#[derive(StructOpt)]

graphql_client_cli/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# GraphQL client CLI
22

3-
This is still a WIP, the main use for it now is to download the schema.json from a GraphQL endpoint, which you can also do with [apollo-codegen](https://github.com/apollographql/apollo-cli).
3+
This is still a WIP, the main use for it now is to download the `schema.json` from a GraphQL endpoint, which you can also do with [apollo-codegen](https://github.com/apollographql/apollo-cli).

graphql_client_cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::path::PathBuf;
1313
use structopt::StructOpt;
1414

1515
#[derive(GraphQLQuery)]
16-
#[gql(
16+
#[graphql(
1717
schema_path = "src/introspection_schema.graphql", query_path = "src/introspection_query.graphql"
1818
)]
1919
struct IntrospectionQuery;

graphql_query_derive/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ mod tests;
3737
use heck::*;
3838
use proc_macro2::{Ident, Span};
3939

40-
#[proc_macro_derive(GraphQLQuery, attributes(gql))]
40+
#[proc_macro_derive(GraphQLQuery, attributes(graphql))]
4141
pub fn graphql_query_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
4242
let input = TokenStream::from(input);
4343
let ast = syn::parse2(input).expect("Derive input is well formed");
@@ -138,9 +138,9 @@ fn extract_attr(ast: &syn::DeriveInput, attr: &str) -> Result<String, failure::E
138138
.iter()
139139
.find(|attr| {
140140
let path = &attr.path;
141-
quote!(#path).to_string() == "gql"
141+
quote!(#path).to_string() == "graphql"
142142
})
143-
.ok_or_else(|| format_err!("The gql attribute is missing"))?;
143+
.ok_or_else(|| format_err!("The graphql attribute is missing"))?;
144144
if let syn::Meta::List(items) = &attribute
145145
.interpret_meta()
146146
.expect("Attribute is well formatted")

tests/input_object_variables.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ extern crate serde;
66
extern crate serde_json;
77

88
#[derive(GraphQLQuery)]
9-
#[gql(
9+
#[graphql(
1010
query_path = "tests/input_object_variables/input_object_variables_query.graphql",
1111
schema_path = "tests/input_object_variables/input_object_variables_schema.graphql"
1212
)]
@@ -28,7 +28,7 @@ fn input_object_variables_query_variables_struct() {
2828
}
2929

3030
#[derive(GraphQLQuery)]
31-
#[gql(
31+
#[graphql(
3232
query_path = "tests/input_object_variables/input_object_variables_query_defaults.graphql",
3333
schema_path = "tests/input_object_variables/input_object_variables_schema.graphql"
3434
)]

tests/interfaces.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ extern crate serde_json;
88
const RESPONSE: &'static str = include_str!("interfaces/interface_response.json");
99

1010
#[derive(GraphQLQuery)]
11-
#[gql(
11+
#[graphql(
1212
query_path = "tests/interfaces/interface_query.graphql",
1313
schema_path = "tests/interfaces/interface_schema.graphql"
1414
)]
@@ -30,7 +30,7 @@ fn interface_deserialization() {
3030
}
3131

3232
#[derive(GraphQLQuery)]
33-
#[gql(
33+
#[graphql(
3434
query_path = "tests/interfaces/interface_not_on_everything_query.graphql",
3535
schema_path = "tests/interfaces/interface_schema.graphql"
3636
)]

tests/introspection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern crate serde_derive;
55
extern crate serde;
66

77
#[derive(GraphQLQuery)]
8-
#[gql(
8+
#[graphql(
99
query_path = "tests/introspection/introspection_query.graphql",
1010
schema_path = "tests/introspection/introspection_schema.graphql"
1111
)]

0 commit comments

Comments
 (0)