-
-
Save reime005/2faf777f33f342d0e84fc81fed64d4ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(GraphQLObject)] | |
#[graphql(description = "some text that will appear in the schema")] | |
pub struct GraphedPokemon { | |
pub id: String, | |
pub name: String | |
} | |
impl From<Pokemon> for GraphedPokemon { | |
fn from(obj: Berry) -> Self { | |
GraphedPokemon { | |
id: obj.id.to_string(), // "obj.id" is "i16" | |
name: obj.name // "obj.name" is "String" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment