diff options
| author | Eugen Wissner <belka@caraus.de> | 2020-07-17 07:05:03 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2020-07-17 07:05:03 +0200 |
| commit | 09135c581aaae471f7d964bc2a3a141bef299097 (patch) | |
| tree | bf26b907a13e5f358f91e4c2d7ef661e74fa6805 /tests/Test/StarWars/QuerySpec.hs | |
| parent | e24386402be444e643d7d9c8ef82c1fe2205c7fc (diff) | |
| download | graphql-09135c581aaae471f7d964bc2a3a141bef299097.tar.gz | |
Constrain base monad to MonadCatch
Let's try MonadThrow/MonadCatch. It looks nice at a first glance. The
monad transformer stack contains only the ReaderT, less lifts are
required. Exception subtyping is easier, the user can (and should)
define custom error types and throw them. And it is still possible to
use pure error handling, if someone doesn't like runtime exceptions or
need to run a query in a pure environment.
Fixes #42.
Diffstat (limited to 'tests/Test/StarWars/QuerySpec.hs')
| -rw-r--r-- | tests/Test/StarWars/QuerySpec.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/Test/StarWars/QuerySpec.hs b/tests/Test/StarWars/QuerySpec.hs index 4e48dbf..301fb7c 100644 --- a/tests/Test/StarWars/QuerySpec.hs +++ b/tests/Test/StarWars/QuerySpec.hs @@ -6,7 +6,6 @@ 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,8 +356,11 @@ spec = describe "Star Wars Query Tests" $ do alderaan = "homePlanet" .= ("Alderaan" :: Text) testQuery :: Text -> Aeson.Value -> Expectation -testQuery q expected = runIdentity (graphql schema q) `shouldBe` expected +testQuery q expected = + let Right actual = graphql schema q + in actual `shouldBe` expected testQueryParams :: Aeson.Object -> Text -> Aeson.Value -> Expectation testQueryParams f q expected = - runIdentity (graphqlSubs schema Nothing f q) `shouldBe` expected + let Right actual = graphqlSubs schema Nothing f q + in actual `shouldBe` expected |
