From d12577ae717512979c7654191ca65f25fc877907 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Wed, 27 May 2020 23:18:35 +0200 Subject: Define resolvers on type fields Returning resolvers from other resolvers isn't supported anymore. Since we have a type system now, we define the resolvers in the object type fields and pass an object with the previous result to them. --- tests/Test/StarWars/Data.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/Test/StarWars/Data.hs') diff --git a/tests/Test/StarWars/Data.hs b/tests/Test/StarWars/Data.hs index 67a74cd..bfbe836 100644 --- a/tests/Test/StarWars/Data.hs +++ b/tests/Test/StarWars/Data.hs @@ -66,8 +66,8 @@ appearsIn :: Character -> [Int] appearsIn (Left x) = _appearsIn . _droidChar $ x appearsIn (Right x) = _appearsIn . _humanChar $ x -secretBackstory :: Character -> ActionT Identity Text -secretBackstory = const $ ActionT $ throwE "secretBackstory is secret." +secretBackstory :: ActionT Identity Text +secretBackstory = ActionT $ throwE "secretBackstory is secret." typeName :: Character -> Text typeName = either (const "Droid") (const "Human") -- cgit v1.2.3