24 lines
346 B
Rust
24 lines
346 B
Rust
|
#[derive(juniper::GraphQLEnum)]
|
||
|
#[graphql(context = ())]
|
||
|
pub enum Test {
|
||
|
A,
|
||
|
B,
|
||
|
}
|
||
|
|
||
|
enum Character {
|
||
|
Test(Test),
|
||
|
}
|
||
|
|
||
|
#[juniper::graphql_union]
|
||
|
impl Character {
|
||
|
fn resolve(&self) {
|
||
|
match self {
|
||
|
Test => match *self {
|
||
|
Character::Test(ref h) => Some(h),
|
||
|
},
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
fn main() {}
|