Merge pull request #395 from leebenson/leebenson/default_with

Book fix for `default_with`
This commit is contained in:
Sunli 2021-01-19 20:08:23 +08:00 committed by GitHub
commit 28577d80a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -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),
@ -56,7 +56,7 @@ struct MyInputObject {
#[graphql(default = 10)]
value2: i32,
#[graphql(default = "my_default()")]
#[graphql(default_with = "my_default()")]
value3: i32,
}
```

View File

@ -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),
@ -55,7 +55,7 @@ struct MyInputObject {
#[graphql(default = 10)]
value2: i32,
#[graphql(default = "my_default()")]
#[graphql(default_with = "my_default()")]
value3: i32,
}
```