summaryrefslogtreecommitdiff
path: root/tests/Test/FragmentSpec.hs
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2020-09-25 21:57:25 +0200
committerEugen Wissner <belka@caraus.de>2020-09-26 07:57:25 +0200
commit3373c94895c148ffec199842305e10528440e5bd (patch)
tree87fd2ebe0265bdaa486fb149481f599b1f9ba17f /tests/Test/FragmentSpec.hs
parent9bfa2aa7e8a72c9cc08743152a96d18312625712 (diff)
downloadgraphql-3373c94895c148ffec199842305e10528440e5bd.tar.gz
Validate field selections on composite types
Diffstat (limited to 'tests/Test/FragmentSpec.hs')
-rw-r--r--tests/Test/FragmentSpec.hs16
1 files changed, 6 insertions, 10 deletions
diff --git a/tests/Test/FragmentSpec.hs b/tests/Test/FragmentSpec.hs
index 27b08a2..8ee1ad2 100644
--- a/tests/Test/FragmentSpec.hs
+++ b/tests/Test/FragmentSpec.hs
@@ -108,20 +108,16 @@ spec = do
it "embeds inline fragments without type" $ do
let sourceQuery = [r|{
- garment {
- circumference
- ... {
- size
- }
+ circumference
+ ... {
+ size
}
}|]
- actual <- graphql (toSchema "garment" $ garment "Hat") sourceQuery
+ actual <- graphql (toSchema "circumference" circumference) sourceQuery
let expected = HashMap.singleton "data"
$ Aeson.object
- [ "garment" .= Aeson.object
- [ "circumference" .= (60 :: Int)
- , "size" .= ("L" :: Text)
- ]
+ [ "circumference" .= (60 :: Int)
+ , "size" .= ("L" :: Text)
]
in actual `shouldResolveTo` expected