diff options
| author | Eugen Wissner <belka@caraus.de> | 2020-05-10 18:32:58 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2020-05-10 18:32:58 +0200 |
| commit | 500cff20eb21b28359400b99a4dfda4009229b95 (patch) | |
| tree | 37ccfe12ef99c29905934cde2339dad6a3900279 /tests/Test/FragmentSpec.hs | |
| parent | 387d158bd1192e459d06c29e2ae923b7b30ffa4a (diff) | |
| download | graphql-500cff20eb21b28359400b99a4dfda4009229b95.tar.gz | |
Separate Query and Mutation resolvers
Fixes #33 .
Diffstat (limited to 'tests/Test/FragmentSpec.hs')
| -rw-r--r-- | tests/Test/FragmentSpec.hs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/Test/FragmentSpec.hs b/tests/Test/FragmentSpec.hs index de10d63..74293a9 100644 --- a/tests/Test/FragmentSpec.hs +++ b/tests/Test/FragmentSpec.hs @@ -51,7 +51,7 @@ spec :: Spec spec = do describe "Inline fragment executor" $ do it "chooses the first selection if the type matches" $ do - actual <- graphql (garment "Hat" :| []) inlineQuery + actual <- graphql (HashMap.singleton "Query" $ garment "Hat" :| []) inlineQuery let expected = object [ "data" .= object [ "garment" .= object @@ -62,7 +62,7 @@ spec = do in actual `shouldBe` expected it "chooses the last selection if the type matches" $ do - actual <- graphql (garment "Shirt" :| []) inlineQuery + actual <- graphql (HashMap.singleton "Query" $ garment "Shirt" :| []) inlineQuery let expected = object [ "data" .= object [ "garment" .= object @@ -83,7 +83,7 @@ spec = do }|] resolvers = Schema.object "garment" $ return [circumference, size] - actual <- graphql (resolvers :| []) query + actual <- graphql (HashMap.singleton "Query" $ resolvers :| []) query let expected = object [ "data" .= object [ "garment" .= object @@ -101,7 +101,7 @@ spec = do } }|] - actual <- graphql (size :| []) query + actual <- graphql (HashMap.singleton "Query" $ size :| []) query actual `shouldNotSatisfy` hasErrors describe "Fragment spread executor" $ do @@ -116,7 +116,7 @@ spec = do } |] - actual <- graphql (circumference :| []) query + actual <- graphql (HashMap.singleton "Query" $ circumference :| []) query let expected = object [ "data" .= object [ "circumference" .= (60 :: Int) @@ -141,7 +141,7 @@ spec = do } |] - actual <- graphql (garment "Hat" :| []) query + actual <- graphql (HashMap.singleton "Query" $ garment "Hat" :| []) query let expected = object [ "data" .= object [ "garment" .= object @@ -162,7 +162,7 @@ spec = do } |] - actual <- graphql (circumference :| []) query + actual <- graphql (HashMap.singleton "Query" $ circumference :| []) query actual `shouldSatisfy` hasErrors it "considers type condition" $ do @@ -187,5 +187,5 @@ spec = do ] ] ] - actual <- graphql (garment "Hat" :| []) query + actual <- graphql (HashMap.singleton "Query" $ garment "Hat" :| []) query actual `shouldBe` expected |
