From 2f9881bb211fa40361a745078ed790e19747c801 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sat, 24 Dec 2022 18:09:52 +0100 Subject: Fix GHC 9.2 warnings and deprecations - Fix GHC 9.2 warnings - Convert comments to proper deprecations --- src/Language/GraphQL.hs | 2 ++ src/Language/GraphQL/Error.hs | 12 +++--------- src/Test/Hspec/GraphQL.hs | 4 ++-- 3 files changed, 7 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/Language/GraphQL.hs b/src/Language/GraphQL.hs index d54ae60..4f3e8d9 100644 --- a/src/Language/GraphQL.hs +++ b/src/Language/GraphQL.hs @@ -45,6 +45,7 @@ import qualified Language.GraphQL.Validate as Validate import Language.GraphQL.Type.Schema (Schema) import Text.Megaparsec (parse) +{-# DEPRECATED graphql "Use graphql-spice package instead" #-} -- | If the text parses correctly as a @GraphQL@ query the query is -- executed using the given 'Schema'. graphql :: MonadCatch m @@ -53,6 +54,7 @@ graphql :: MonadCatch m -> m (Either (ResponseEventStream m Aeson.Value) Aeson.Object) -- ^ Response. graphql schema = graphqlSubs schema mempty mempty +{-# DEPRECATED graphqlSubs "Use graphql-spice package instead" #-} -- | If the text parses correctly as a @GraphQL@ query the substitution is -- applied to the query and the query is then executed using to the given -- 'Schema'. diff --git a/src/Language/GraphQL/Error.hs b/src/Language/GraphQL/Error.hs index 403aaf6..87ee702 100644 --- a/src/Language/GraphQL/Error.hs +++ b/src/Language/GraphQL/Error.hs @@ -100,11 +100,9 @@ instance Exception ResolverException -- * Deprecated +{-# DEPRECATED runCollectErrs "runCollectErrs was part of the old executor and isn't used anymore" #-} -- | Runs the given query computation, but collects the errors into an error -- list, which is then sent back with the data. --- --- {-# DEPRECATED runCollectErrs was part of the old executor and isn't used --- anymore #-} runCollectErrs :: (Monad m, Serialize a) => HashMap Name (Schema.Type m) -> CollectErrsT m a @@ -114,17 +112,13 @@ runCollectErrs types' res = do $ Resolution{ errors = Seq.empty, types = types' } pure $ Response dat errors +{-# DEPRECATED Resolution "Resolution was part of the old executor and isn't used anymore" #-} -- | Executor context. --- --- {-# DEPRECATED Resolution was part of the old executor and isn't used --- anymore #-} data Resolution m = Resolution { errors :: Seq Error , types :: HashMap Name (Schema.Type m) } +{-# DEPRECATED CollectErrsT "CollectErrsT was part of the old executor and isn't used anymore" #-} -- | A wrapper to pass error messages around. --- --- {-# DEPRECATED CollectErrsT was part of the old executor and isn't used --- anymore #-} type CollectErrsT m = StateT (Resolution m) m diff --git a/src/Test/Hspec/GraphQL.hs b/src/Test/Hspec/GraphQL.hs index 5d812bf..a848c15 100644 --- a/src/Test/Hspec/GraphQL.hs +++ b/src/Test/Hspec/GraphQL.hs @@ -9,7 +9,7 @@ {-# LANGUAGE OverloadedStrings #-} -- | Test helpers. -module Test.Hspec.GraphQL +module Test.Hspec.GraphQL {-# DEPRECATED "Use graphql-spice package instead" #-} ( shouldResolve , shouldResolveTo ) where @@ -43,7 +43,7 @@ shouldResolve executor query = do _ -> expectationFailure "the query is expected to resolve to a value, but it resolved to an event stream" #else -module Test.Hspec.GraphQL +module Test.Hspec.GraphQL {-# DEPRECATED "Use graphql-spice package instead" #-} ( ) where #endif -- cgit v1.2.3