diff --git a/docs/en/src/default_value.md b/docs/en/src/default_value.md index 2e4b52f1..63110662 100644 --- a/docs/en/src/default_value.md +++ b/docs/en/src/default_value.md @@ -18,7 +18,7 @@ fn my_default() -> i32 { impl Query { // The default value of the value parameter is 0, it will call i32::default() fn test1(&self, #[graphql(default)] value: i32) {} - + // The default value of the value parameter is 10 fn test2(&self, #[graphql(default = 10)] value: i32) {} @@ -36,7 +36,7 @@ use async_graphql::*; #[graphql( field(name = "test1", arg(name = "value", default)), field(name = "test2", arg(name = "value", default = 10)), - field(name = "test3", arg(name = "value", default = "my_default()")), + field(name = "test3", arg(name = "value", default_with = "my_default()")), )] enum MyInterface { MyObj(MyObj), @@ -52,11 +52,11 @@ use async_graphql::*; struct MyInputObject { #[graphql(default)] value1: i32, - + #[graphql(default = 10)] value2: i32, - #[graphql(default = "my_default()")] + #[graphql(default_with = "my_default()")] value3: i32, } ``` diff --git a/docs/zh-CN/src/default_value.md b/docs/zh-CN/src/default_value.md index 8342f566..c1faa787 100644 --- a/docs/zh-CN/src/default_value.md +++ b/docs/zh-CN/src/default_value.md @@ -17,7 +17,7 @@ fn my_default() -> i32 { impl Query { // value参数的默认值为0,它会调用i32::default() fn test1(&self, #[graphql(default)] value: i32) {} - + // value参数的默认值为10 fn test2(&self, #[graphql(default = 10)] value: i32) {} @@ -35,7 +35,7 @@ use async_graphql::*; #[graphql( field(name = "test1", arg(name = "value", default)), field(name = "test2", arg(name = "value", default = 10)), - field(name = "test3", arg(name = "value", default = "my_default()")), + field(name = "test3", arg(name = "value", default_with = "my_default()")), )] enum MyInterface { MyObj(MyObj), @@ -51,11 +51,11 @@ use async_graphql::*; struct MyInputObject { #[graphql(default)] value1: i32, - + #[graphql(default = 10)] value2: i32, - #[graphql(default = "my_default()")] + #[graphql(default_with = "my_default()")] value3: i32, } -``` \ No newline at end of file +```