Implement appears_in for concrete types in test schema

This commit is contained in:
Magnus Hallin 2016-09-18 17:23:31 +02:00
parent c1b7bf8b46
commit 2be6f7416e

View file

@ -51,6 +51,10 @@ graphql_object!(<'a> &'a Human: Database as "Human" |&self| {
Ok(executor.context().get_friends(self.as_character()))
}
field appears_in() -> FieldResult<&[Episode]> as "Which movies they appear in" {
Ok(self.appears_in())
}
field home_planet() -> FieldResult<&Option<String>> as "The home planet of the human" {
Ok(self.home_planet())
}
@ -74,6 +78,10 @@ graphql_object!(<'a> &'a Droid: Database as "Droid" |&self| {
Ok(executor.context().get_friends(self.as_character()))
}
field appears_in() -> FieldResult<&[Episode]> as "Which movies they appear in" {
Ok(self.appears_in())
}
field primary_function() -> FieldResult<&Option<String>> as "The primary function of the droid" {
Ok(self.primary_function())
}