diff options
| author | Eugen Wissner <belka@caraus.de> | 2020-05-14 09:17:14 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2020-05-14 22:16:56 +0200 |
| commit | a5c44f30facdaabd94ed25953a3bd88005efa868 (patch) | |
| tree | bf768b92b5b3ecab5c939d04bf4ec6ebdb7e5257 /tests/Test/QuerySpec.hs | |
| parent | 4c19c88e98bea77ebccc786cd55b30e23ab6e897 (diff) | |
| download | graphql-a5c44f30facdaabd94ed25953a3bd88005efa868.tar.gz | |
Add basic output object type support
Diffstat (limited to 'tests/Test/QuerySpec.hs')
| -rw-r--r-- | tests/Test/QuerySpec.hs | 40 |
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) |
