From 2be6f7416e8b16973d48a2c045d91c3b86f656de Mon Sep 17 00:00:00 2001 From: Magnus Hallin Date: Sun, 18 Sep 2016 17:23:31 +0200 Subject: [PATCH] Implement appears_in for concrete types in test schema --- src/tests/schema.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tests/schema.rs b/src/tests/schema.rs index aa5c3a2b..3793cabd 100644 --- a/src/tests/schema.rs +++ b/src/tests/schema.rs @@ -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> 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> as "The primary function of the droid" { Ok(self.primary_function()) }