summaryrefslogtreecommitdiff
path: root/tests/Test/RootOperationSpec.hs
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2020-10-07 05:24:51 +0200
committerEugen Wissner <belka@caraus.de>2020-10-07 05:24:51 +0200
commit7c0b0ace4dacbb581669f88b83b9643a83fc797a (patch)
treeec9e5a55764c63203f09fc5c9b60990cd4b2aac7 /tests/Test/RootOperationSpec.hs
parenta91bc7f2d218ea2df308d3968587b60351625150 (diff)
downloadgraphql-7c0b0ace4dacbb581669f88b83b9643a83fc797a.tar.gz
Collect types once the schema is created
Diffstat (limited to 'tests/Test/RootOperationSpec.hs')
-rw-r--r--tests/Test/RootOperationSpec.hs9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/Test/RootOperationSpec.hs b/tests/Test/RootOperationSpec.hs
index 33b5d3b..1921ec9 100644
--- a/tests/Test/RootOperationSpec.hs
+++ b/tests/Test/RootOperationSpec.hs
@@ -24,13 +24,10 @@ hatType = Out.ObjectType "Hat" Nothing []
$ pure $ Int 60
garmentSchema :: Schema IO
-garmentSchema = Schema
- { query = Out.ObjectType "Query" Nothing [] hatFieldResolver
- , mutation = Just $ Out.ObjectType "Mutation" Nothing [] incrementFieldResolver
- , subscription = Nothing
- , directives = HashMap.empty
- }
+garmentSchema = schema queryType (Just mutationType) Nothing mempty
where
+ queryType = Out.ObjectType "Query" Nothing [] hatFieldResolver
+ mutationType = Out.ObjectType "Mutation" Nothing [] incrementFieldResolver
garment = pure $ Object $ HashMap.fromList
[ ("circumference", Int 60)
]