Implement appears_in for concrete types in test schema
This commit is contained in:
parent
c1b7bf8b46
commit
2be6f7416e
1 changed files with 8 additions and 0 deletions
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue