aboutsummaryrefslogtreecommitdiff
path: root/tests/Test/RootOperationSpec.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Test/RootOperationSpec.hs')
-rw-r--r--tests/Test/RootOperationSpec.hs14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/Test/RootOperationSpec.hs b/tests/Test/RootOperationSpec.hs
index ea89279..1921ec9 100644
--- a/tests/Test/RootOperationSpec.hs
+++ b/tests/Test/RootOperationSpec.hs
@@ -23,13 +23,11 @@ hatType = Out.ObjectType "Hat" Nothing []
$ ValueResolver (Out.Field Nothing (Out.NamedScalarType int) mempty)
$ pure $ Int 60
-schema :: Schema IO
-schema = Schema
- { query = Out.ObjectType "Query" Nothing [] hatFieldResolver
- , mutation = Just $ Out.ObjectType "Mutation" Nothing [] incrementFieldResolver
- , subscription = Nothing
- }
+garmentSchema :: Schema IO
+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)
]
@@ -57,7 +55,7 @@ spec =
[ "circumference" .= (60 :: Int)
]
]
- actual <- graphql schema querySource
+ actual <- graphql garmentSchema querySource
actual `shouldResolveTo` expected
it "chooses Mutation" $ do
@@ -70,5 +68,5 @@ spec =
$ object
[ "incrementCircumference" .= (61 :: Int)
]
- actual <- graphql schema querySource
+ actual <- graphql garmentSchema querySource
actual `shouldResolveTo` expected