Fix for default_with

Signed-off-by: Lee Benson <lee@leebenson.com>
This commit is contained in:
Lee Benson 2021-01-19 09:53:29 +00:00
parent bce55dec08
commit 2d59fbed4a
No known key found for this signature in database
GPG Key ID: 8DB0E253C0FFA8AB
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,
}
```