Skip to content

Instantly share code, notes, and snippets.

@reime005
Last active February 8, 2021 00:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reime005/22bd15cb74a651f57df739583a0383bf to your computer and use it in GitHub Desktop.
Save reime005/22bd15cb74a651f57df739583a0383bf to your computer and use it in GitHub Desktop.
#[graphql(description = "Retrieve a pokemon by its name")]
fn pokemon_by_name(_context: &Context, name: String) -> FieldResult<GraphedPokemon> {
let obj = Pokemon::from_name(&name)?;
Ok(GraphedPokemon::from(obj))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment