Document input object default values

This commit is contained in:
Magnus Hallin 2017-02-19 12:51:12 +01:00
parent 0b07dbe99a
commit 2f79f33a82

View file

@ -9,7 +9,7 @@ is what will be generated:
```rust
# #[macro_use] extern crate juniper;
#
graphql_input_object!(
description: "Coordinates for the user"
@ -29,6 +29,21 @@ and arguments.
If you want to expose the struct under a different name than the Rust
type, you can write `struct Coordinates as "MyCoordinates" { ...`.
You can specify *default values* for input object fields; the syntax
is similar to argument default values:
```rust
# #[macro_use] extern crate juniper;
#
graphql_input_object!(
struct SampleObject {
foo = 123: i64 as "A sample field, defaults to 123 if omitted"
}
);
# fn main() { }
```
*/
#[macro_export]
macro_rules! graphql_input_object {