From f318eaba5091e47197239dd949266081a403b135 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 27 Nov 2021 10:19:06 -0500 Subject: [PATCH] graphql_client_codegen: trim whitespace from derives This is done already in the `response_derives`, but was missed for variables. --- CHANGELOG.md | 2 ++ graphql_client_codegen/src/codegen_options.rs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69991ccf..0cf3f1a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## Unreleased +- The `variables_derives` now trims whitespace from individual derivation traits. + ## 0.10.0 - 2021-07-04 - The `web` feature is dropped. You can now use a `reqwest::Client` instead of the custom HTTP client. diff --git a/graphql_client_codegen/src/codegen_options.rs b/graphql_client_codegen/src/codegen_options.rs index 634088f7..675b1f10 100644 --- a/graphql_client_codegen/src/codegen_options.rs +++ b/graphql_client_codegen/src/codegen_options.rs @@ -102,7 +102,8 @@ impl GraphQLClientCodegenOptions { .variables_derives .as_deref() .into_iter() - .flat_map(|s| s.split(',')); + .flat_map(|s| s.split(',')) + .map(|s| s.trim()); std::iter::once("Serialize").chain(additional) }