Update graphql_enum! documentation
This commit is contained in:
parent
ac01b8e406
commit
ca6c637aa4
1 changed files with 6 additions and 2 deletions
|
@ -9,14 +9,18 @@ non-data carrying Rust enums to GraphQL:
|
||||||
# #[macro_use] extern crate juniper;
|
# #[macro_use] extern crate juniper;
|
||||||
enum Color {
|
enum Color {
|
||||||
Red,
|
Red,
|
||||||
|
Orange,
|
||||||
Green,
|
Green,
|
||||||
Blue
|
Blue,
|
||||||
|
Black,
|
||||||
}
|
}
|
||||||
|
|
||||||
graphql_enum!(Color {
|
graphql_enum!(Color {
|
||||||
Color::Red => "RED",
|
Color::Red => "RED" as "The color red",
|
||||||
|
Color::Orange => "ORANGE",
|
||||||
Color::Green => "GREEN",
|
Color::Green => "GREEN",
|
||||||
Color::Blue => "BLUE",
|
Color::Blue => "BLUE",
|
||||||
|
Color::Black => "BLACK" deprecated "Superseded by ORANGE",
|
||||||
});
|
});
|
||||||
|
|
||||||
# fn main() { }
|
# fn main() { }
|
||||||
|
|
Loading…
Add table
Reference in a new issue