Replace MonadIO constraint with just Monad

And make the tests use Identity instead of IO.
This commit is contained in:
2020-02-01 20:46:35 +01:00
parent e8b82122c6
commit 67bebf853c
8 changed files with 32 additions and 37 deletions

View File

@ -6,6 +6,7 @@ module Test.StarWars.QuerySpec
import qualified Data.Aeson as Aeson
import Data.Aeson ((.=))
import Data.Functor.Identity (Identity(..))
import qualified Data.HashMap.Strict as HashMap
import Data.Text (Text)
import Language.GraphQL
@ -357,7 +358,8 @@ spec = describe "Star Wars Query Tests" $ do
alderaan = "homePlanet" .= ("Alderaan" :: Text)
testQuery :: Text -> Aeson.Value -> Expectation
testQuery q expected = graphql schema q >>= flip shouldBe expected
testQuery q expected = runIdentity (graphql schema q) `shouldBe` expected
testQueryParams :: Subs -> Text -> Aeson.Value -> Expectation
testQueryParams f q expected = graphqlSubs schema f q >>= flip shouldBe expected
testQueryParams f q expected =
runIdentity (graphqlSubs schema f q) `shouldBe` expected