Skip to content

Upgrade heck dependency #406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion graphql_client_codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ edition = "2018"
[dependencies]
graphql-introspection-query = { version = "0.2.0", path = "../graphql-introspection-query" }
graphql-parser = "^0.2"
heck = "0.3"
heck = "0.4.0"
lazy_static = "1.3"
proc-macro2 = { version = "^1.0", features = [] }
quote = "^1.0"
Expand Down
2 changes: 1 addition & 1 deletion graphql_client_codegen/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{
type_qualifiers::GraphqlTypeQualifier,
GeneralError, GraphQLClientCodegenOptions,
};
use heck::SnakeCase;
use heck::ToSnakeCase;
use proc_macro2::{Ident, Span, TokenStream};
use quote::quote;
use selection::*;
Expand Down
2 changes: 1 addition & 1 deletion graphql_client_codegen/src/codegen/inputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
query::{BoundQuery, UsedTypes},
schema::input_is_recursive_without_indirection,
};
use heck::SnakeCase;
use heck::ToSnakeCase;
use proc_macro2::{Ident, Span, TokenStream};
use quote::quote;

Expand Down
4 changes: 2 additions & 2 deletions graphql_client_codegen/src/normalization.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use heck::CamelCase;
use heck::ToUpperCamelCase;
use std::borrow::Cow;

/// Normalization conventions available for generated code.
Expand All @@ -14,7 +14,7 @@ impl Normalization {
fn camel_case(self, name: &str) -> Cow<'_, str> {
match self {
Self::None => name.into(),
Self::Rust => name.to_camel_case().into(),
Self::Rust => name.to_upper_camel_case().into(),
}
}

Expand Down
2 changes: 1 addition & 1 deletion graphql_client_codegen/src/query/fragments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub(crate) struct ResolvedFragment {

impl ResolvedFragment {
pub(super) fn to_path_segment(&self) -> String {
self.name.to_camel_case()
self.name.to_upper_camel_case()
}
}

Expand Down
2 changes: 1 addition & 1 deletion graphql_client_codegen/src/query/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ pub(crate) struct ResolvedOperation {

impl ResolvedOperation {
pub(crate) fn to_path_segment(&self) -> String {
self.name.to_camel_case()
self.name.to_upper_camel_case()
}
}
8 changes: 4 additions & 4 deletions graphql_client_codegen/src/query/selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use super::{
UsedTypes,
};
use crate::schema::{Schema, StoredField, StoredFieldId, TypeId};
use heck::CamelCase;
use heck::ToUpperCamelCase;

/// This checks that the `on` clause on fragment spreads and inline fragments
/// are valid in their context.
Expand Down Expand Up @@ -226,13 +226,13 @@ impl Selection {
Selection::Field(field) => field
.alias
.as_ref()
.map(|alias| alias.to_camel_case())
.map(|alias| alias.to_upper_camel_case())
.unwrap_or_else(move || {
query.schema.get_field(field.field_id).name.to_camel_case()
query.schema.get_field(field.field_id).name.to_upper_camel_case()
}),
Selection::InlineFragment(inline_fragment) => format!(
"On{}",
inline_fragment.type_id.name(query.schema).to_camel_case()
inline_fragment.type_id.name(query.schema).to_upper_camel_case()
),
other => unreachable!("{:?} in to_path_segment", other),
}
Expand Down