summaryrefslogtreecommitdiff
path: root/tests/Test/QuerySpec.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Test/QuerySpec.hs')
-rw-r--r--tests/Test/QuerySpec.hs40
1 files changed, 0 insertions, 40 deletions
diff --git a/tests/Test/QuerySpec.hs b/tests/Test/QuerySpec.hs
deleted file mode 100644
index 95608b0..0000000
--- a/tests/Test/QuerySpec.hs
+++ /dev/null
@@ -1,40 +0,0 @@
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE QuasiQuotes #-}
-module Test.QuerySpec
- ( spec
- ) where
-
-import Data.Aeson ((.=), object)
-import qualified Data.HashMap.Strict as HashMap
-import Data.List.NonEmpty (NonEmpty(..))
-import Language.GraphQL
-import qualified Language.GraphQL.Schema as Schema
-import Test.Hspec (Spec, describe, it, shouldBe)
-import Text.RawString.QQ (r)
-
-spec :: Spec
-spec =
- describe "Query executor" $
- it "returns objects from the root resolvers" $ 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)