summaryrefslogtreecommitdiff
path: root/tests/Language/GraphQL/ExecuteSpec.hs
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2020-06-29 13:14:23 +0200
committerEugen Wissner <belka@caraus.de>2020-06-29 13:14:23 +0200
commit705e506c13b6c0f67ddf0195fa0d3256e7e4f9c3 (patch)
tree58e41bdbd246fc5b947a848283d6688c7ddf636b /tests/Language/GraphQL/ExecuteSpec.hs
parent9798b08b4c25685e92a7f537f68f35994a5a4899 (diff)
downloadgraphql-705e506c13b6c0f67ddf0195fa0d3256e7e4f9c3.tar.gz
Combine Resolver and ActionT in ResolverT
Diffstat (limited to 'tests/Language/GraphQL/ExecuteSpec.hs')
-rw-r--r--tests/Language/GraphQL/ExecuteSpec.hs24
1 files changed, 12 insertions, 12 deletions
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 =