summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2022-12-24 18:09:52 +0100
committerEugen Wissner <belka@caraus.de>2022-12-24 18:09:52 +0100
commit2f9881bb211fa40361a745078ed790e19747c801 (patch)
treed986d5fdb5179d2b206eba5d6010763f6e18fa6b /tests
parentbf2e4925b45991476c430bd635d8fbabe7cbecbf (diff)
downloadgraphql-2f9881bb211fa40361a745078ed790e19747c801.tar.gz
Fix GHC 9.2 warnings and deprecations
- Fix GHC 9.2 warnings - Convert comments to proper deprecations
Diffstat (limited to 'tests')
-rw-r--r--tests/Language/GraphQL/ExecuteSpec.hs16
-rw-r--r--tests/Schemas/HeroSchema.hs8
2 files changed, 12 insertions, 12 deletions
diff --git a/tests/Language/GraphQL/ExecuteSpec.hs b/tests/Language/GraphQL/ExecuteSpec.hs
index 58aeb70..c313df0 100644
--- a/tests/Language/GraphQL/ExecuteSpec.hs
+++ b/tests/Language/GraphQL/ExecuteSpec.hs
@@ -13,7 +13,7 @@ module Language.GraphQL.ExecuteSpec
( spec
) where
-import Control.Exception (Exception(..), SomeException)
+import Control.Exception (Exception(..))
import Control.Monad.Catch (throwM)
import Data.Conduit
import Data.HashMap.Strict (HashMap)
@@ -202,7 +202,7 @@ schoolType = EnumType "School" Nothing $ HashMap.fromList
]
type EitherStreamOrValue = Either
- (ResponseEventStream (Either SomeException) Type.Value)
+ (ResponseEventStream IO Type.Value)
(Response Type.Value)
-- Asserts that a query resolves to a value.
@@ -414,16 +414,16 @@ spec =
in sourceQuery `shouldResolveTo` expected
context "Error path" $ do
- let executeHero :: Document -> Either SomeException EitherStreamOrValue
+ let executeHero :: Document -> IO EitherStreamOrValue
executeHero = execute heroSchema Nothing (HashMap.empty :: HashMap Name Type.Value)
- it "at the beggining of the list" $
- let Right (Right actual) = either (pure . parseError) executeHero
- $ parse document "" "{ hero(id: \"1\") { friends { name } } }"
- Response _ errors' = actual
+ it "at the beggining of the list" $ do
+ Right actual <- either (pure . parseError) executeHero
+ $ parse document "" "{ hero(id: \"1\") { friends { name } } }"
+ let Response _ errors' = actual
Error _ _ path' = fromJust $ Seq.lookup 0 errors'
expected = [Segment "hero", Segment "friends", Index 0, Segment "name"]
- in path' `shouldBe` expected
+ in path' `shouldBe` expected
context "Subscription" $
it "subscribes" $ do
diff --git a/tests/Schemas/HeroSchema.hs b/tests/Schemas/HeroSchema.hs
index 71b7a10..63c461c 100644
--- a/tests/Schemas/HeroSchema.hs
+++ b/tests/Schemas/HeroSchema.hs
@@ -6,7 +6,7 @@
module Schemas.HeroSchema (heroSchema) where
-import Control.Exception (Exception(..), SomeException)
+import Control.Exception (Exception(..))
import Control.Monad.Catch (throwM)
import Language.GraphQL.Error (ResolverException (..))
import qualified Language.GraphQL.Type.In as In
@@ -25,11 +25,11 @@ instance Exception HeroException where
ResolverException resolverException <- fromException e
cast resolverException
-heroSchema :: Type.Schema (Either SomeException)
+heroSchema :: Type.Schema IO
heroSchema =
schemaWithTypes Nothing queryType Nothing Nothing [] mempty
-type ObjectType = Out.ObjectType (Either SomeException)
+type ObjectType = Out.ObjectType IO
queryType :: ObjectType
queryType = Out.ObjectType "Query" Nothing []
@@ -42,7 +42,7 @@ queryType = Out.ObjectType "Query" Nothing []
$ In.Argument Nothing (In.NamedScalarType Type.id) Nothing
heroResolver = pure $ Type.Object mempty
-stringField :: Out.Field (Either SomeException)
+stringField :: Out.Field IO
stringField = Out.Field Nothing (Out.NonNullScalarType Type.string) HashMap.empty
heroType :: ObjectType