Hello, recently I've upgraded graphql-client version from 0.9.0 to 0.10.0 and the variable renaming of nested structs defined in graphql does not rename the variables using camel case anymore. I apologize for the code dump but I think it would be best if I showed what I mean.
error[E0560]: struct `actor_creation::Actor` has no field named `first_name`
--> /tests/test.rs:811:21
|
811 | first_name: "Adam".to_string(),
| ^^^^^^^^ help: a field with a similar name exists: `firstName`
error[E0560]: struct `actor_creation::Actor` has no field named `last_name`
--> /tests/test.rs:812:21
|
812 | last_name: "Driver".to_string(),
| ^^^^^^^^^ help: a field with a similar name exists: `lastName`
error: aborting due to 2 previous errors
Instead with version 0.10.0 I'm having to do the following with camel case:
I spent some time looking for a way to generate the snake case variables but all I could find was the attribute normalization but that did not quite work. Am I missing something, or is there a way to make this happen?
Hello, recently I've upgraded
graphql-client
version from 0.9.0 to 0.10.0 and the variable renaming of nested structs defined in graphql does not rename the variables using camel case anymore. I apologize for the code dump but I think it would be best if I showed what I mean.Say I have the following struct defined:
From which I can generate a
schema.json
file which would contain the following:I also have created a file
query.graphql
to contain the target query to be tested:And somewhere in my rust code I need to build the input for mutation
ActorCreation
, something like:The errors being:
Instead with version 0.10.0 I'm having to do the following with camel case:
I spent some time looking for a way to generate the snake case variables but all I could find was the attribute
normalization
but that did not quite work. Am I missing something, or is there a way to make this happen?Thank you in advance!