summaryrefslogtreecommitdiff
path: root/tests/Test/FragmentSpec.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Test/FragmentSpec.hs')
-rw-r--r--tests/Test/FragmentSpec.hs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/Test/FragmentSpec.hs b/tests/Test/FragmentSpec.hs
index 74293a9..99c0715 100644
--- a/tests/Test/FragmentSpec.hs
+++ b/tests/Test/FragmentSpec.hs
@@ -189,3 +189,27 @@ spec = do
]
actual <- graphql (HashMap.singleton "Query" $ garment "Hat" :| []) query
actual `shouldBe` expected
+
+ it "test1" $ do
+ let query = [r|
+ {
+ garment {
+ circumference
+ }
+ }
+ |]
+ expected = object
+ [ "data" .= object
+ [ "garment" .= object
+ [ "circumference" .= (60 :: Int)
+ ]
+ ]
+ ]
+ actual <- graphql schema query
+ actual `shouldBe` expected
+ where
+ schema = HashMap.singleton "Query" $ garment' :| []
+ garment' = Schema.object "garment" $ return
+ [ circumference'
+ ]
+ circumference' = Schema.scalar "circumference" $ pure (60 :: Int)