juniper icon indicating copy to clipboard operation
juniper copied to clipboard

enhance juniper::GraphQLEnum

Open himself65 opened this issue 5 years ago • 0 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I want to display the integer on enum, like

#[derive(juniper::GraphQLEnum)]
pub enum Gender {
    Man = 0,
    Woman = 1,
}

and

field something(&executor, name: String) -> FieldResult<Something> {
  Ok(Something{
      gender: Gender::Man
  )
}

when I call it and it will display 0 on gender

himself65 avatar Dec 28 '19 06:12 himself65