I have a situation as shown below:
pub struct MyStruct;
#[async_graphql::Object]
impl MyStruct {
// I want to rename this field to 'type' because the crate changes it into 'rType'
pub async fn r#type(&self) -> i32 { 1337 }
}
I have tried applying [arg(name="type")] but that didn't work.
pub struct MyStruct;
#[async_graphql::Object]
impl MyStruct {
#[field(name="type")]
pub async fn r#type(&self) -> i32 { 1337 }
}
#[arg(name="..")] is use for fields argument.
I want to rename this field to 'type' because the crate changes it into 'rType'
If so, it's a bug and I'll see how it works.
This is a bug and you don't need to manually change the field name.
syn gives me rType and doesn't tell me it's actually an r#type, you have to rename the field manually.
That's a bummer, that's lost information. But renaming it isn't too much of a hassle either. Thanks for taking a look 馃憤