Skip to content

Commit 5c8ec75

Browse files
authored
Merge pull request #406 from TethysSvensson/main
2 parents fd5dc3d + fcda0da commit 5c8ec75

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

graphql_client_codegen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ edition = "2018"
1010
[dependencies]
1111
graphql-introspection-query = { version = "0.2.0", path = "../graphql-introspection-query" }
1212
graphql-parser = "^0.2"
13-
heck = "0.3"
13+
heck = "0.4.0"
1414
lazy_static = "1.3"
1515
proc-macro2 = { version = "^1.0", features = [] }
1616
quote = "^1.0"

graphql_client_codegen/src/codegen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::{
99
type_qualifiers::GraphqlTypeQualifier,
1010
GeneralError, GraphQLClientCodegenOptions,
1111
};
12-
use heck::SnakeCase;
12+
use heck::ToSnakeCase;
1313
use proc_macro2::{Ident, Span, TokenStream};
1414
use quote::quote;
1515
use selection::*;

graphql_client_codegen/src/codegen/inputs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::{
44
query::{BoundQuery, UsedTypes},
55
schema::input_is_recursive_without_indirection,
66
};
7-
use heck::SnakeCase;
7+
use heck::ToSnakeCase;
88
use proc_macro2::{Ident, Span, TokenStream};
99
use quote::quote;
1010

graphql_client_codegen/src/normalization.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use heck::CamelCase;
1+
use heck::ToUpperCamelCase;
22
use std::borrow::Cow;
33

44
/// Normalization conventions available for generated code.
@@ -14,7 +14,7 @@ impl Normalization {
1414
fn camel_case(self, name: &str) -> Cow<'_, str> {
1515
match self {
1616
Self::None => name.into(),
17-
Self::Rust => name.to_camel_case().into(),
17+
Self::Rust => name.to_upper_camel_case().into(),
1818
}
1919
}
2020

graphql_client_codegen/src/query/fragments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub(crate) struct ResolvedFragment {
1111

1212
impl ResolvedFragment {
1313
pub(super) fn to_path_segment(&self) -> String {
14-
self.name.to_camel_case()
14+
self.name.to_upper_camel_case()
1515
}
1616
}
1717

graphql_client_codegen/src/query/operations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ pub(crate) struct ResolvedOperation {
1818

1919
impl ResolvedOperation {
2020
pub(crate) fn to_path_segment(&self) -> String {
21-
self.name.to_camel_case()
21+
self.name.to_upper_camel_case()
2222
}
2323
}

graphql_client_codegen/src/query/selection.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use super::{
33
UsedTypes,
44
};
55
use crate::schema::{Schema, StoredField, StoredFieldId, TypeId};
6-
use heck::CamelCase;
6+
use heck::ToUpperCamelCase;
77

88
/// This checks that the `on` clause on fragment spreads and inline fragments
99
/// are valid in their context.
@@ -226,13 +226,13 @@ impl Selection {
226226
Selection::Field(field) => field
227227
.alias
228228
.as_ref()
229-
.map(|alias| alias.to_camel_case())
229+
.map(|alias| alias.to_upper_camel_case())
230230
.unwrap_or_else(move || {
231-
query.schema.get_field(field.field_id).name.to_camel_case()
231+
query.schema.get_field(field.field_id).name.to_upper_camel_case()
232232
}),
233233
Selection::InlineFragment(inline_fragment) => format!(
234234
"On{}",
235-
inline_fragment.type_id.name(query.schema).to_camel_case()
235+
inline_fragment.type_id.name(query.schema).to_upper_camel_case()
236236
),
237237
other => unreachable!("{:?} in to_path_segment", other),
238238
}

0 commit comments

Comments
 (0)