Closed theunkn0wn1 closed 2 months ago
Oops, this is the wrong repository for this
For anyone finding this in the future, async-graphql will implicitly rename fields.
To avoid this behavior, add #[graphql(rename_fields="snake_case")]
as such:
#[derive(SimpleObject)]
#[graphql(rename_fields="snake_case")]
struct DemoObject {
foo: String,
my_snake_case: usize
}
`
This information should be in the book front and center.
async-graphql seems to be renaming struct fields that are
snake_case
to conform topascalCase
. This should be an optional behavior that is opt-in.I am evaluating using async-graphql to replace pieces of an existing api that is exclusively
snake_case
. implicitly renaming these fields will break the API.