From 705e506c13b6c0f67ddf0195fa0d3256e7e4f9c3 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Mon, 29 Jun 2020 13:14:23 +0200 Subject: Combine Resolver and ActionT in ResolverT --- tests/Language/GraphQL/ExecuteSpec.hs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tests/Language') diff --git a/tests/Language/GraphQL/ExecuteSpec.hs b/tests/Language/GraphQL/ExecuteSpec.hs index 30568be..632e4dd 100644 --- a/tests/Language/GraphQL/ExecuteSpec.hs +++ b/tests/Language/GraphQL/ExecuteSpec.hs @@ -22,26 +22,26 @@ schema = Schema {query = queryType, mutation = Nothing} queryType :: Out.ObjectType Identity queryType = Out.ObjectType "Query" Nothing [] - $ HashMap.singleton "philosopher" - $ Out.Resolver philosopherField - $ pure - $ Type.Object mempty + $ HashMap.singleton "philosopher" philosopherField where - philosopherField = - Out.Field Nothing (Out.NonNullObjectType philosopherType) HashMap.empty + philosopherField + = Out.Field Nothing (Out.NonNullObjectType philosopherType) HashMap.empty + $ pure $ Type.Object mempty philosopherType :: Out.ObjectType Identity philosopherType = Out.ObjectType "Philosopher" Nothing [] $ HashMap.fromList resolvers where resolvers = - [ ("firstName", firstNameResolver) - , ("lastName", lastNameResolver) + [ ("firstName", firstNameField) + , ("lastName", lastNameField) ] - firstNameResolver = Out.Resolver firstNameField $ pure $ Type.String "Friedrich" - lastNameResolver = Out.Resolver lastNameField $ pure $ Type.String "Nietzsche" - firstNameField = Out.Field Nothing (Out.NonNullScalarType string) HashMap.empty - lastNameField = Out.Field Nothing (Out.NonNullScalarType string) HashMap.empty + firstNameField + = Out.Field Nothing (Out.NonNullScalarType string) HashMap.empty + $ pure $ Type.String "Friedrich" + lastNameField + = Out.Field Nothing (Out.NonNullScalarType string) HashMap.empty + $ pure $ Type.String "Nietzsche" spec :: Spec spec = -- cgit v1.2.3