diff --git a/CHANGELOG.md b/CHANGELOG.md index 15efd13..a18f097 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on and this project adheres to [Haskell Package Versioning Policy](https://pvp.haskell.org/). +## [Unreleased] +### Changed +- Remove deprecated `runCollectErrs`, `Resolution`, `CollectErrsT` from the + `Error` module. + ## [1.2.0.3] - 2024-01-09 ### Fixed - Fix corrupted source distribution. @@ -519,6 +524,7 @@ and this project adheres to ### Added - Data types for the GraphQL language. +[Unreleased]: https://git.caraus.tech/OSS/graphql/compare/v1.2.0.3...master [1.2.0.3]: https://git.caraus.tech/OSS/graphql/compare/v1.2.0.2...v1.2.0.3 [1.2.0.2]: https://git.caraus.tech/OSS/graphql/compare/v1.2.0.1...v1.2.0.2 [1.2.0.1]: https://git.caraus.tech/OSS/graphql/compare/v1.2.0.0...v1.2.0.1 diff --git a/src/Language/GraphQL/Error.hs b/src/Language/GraphQL/Error.hs index 87ee702..4a406d0 100644 --- a/src/Language/GraphQL/Error.hs +++ b/src/Language/GraphQL/Error.hs @@ -8,28 +8,22 @@ -- | Error handling. module Language.GraphQL.Error - ( CollectErrsT - , Error(..) + ( Error(..) , Path(..) - , Resolution(..) , ResolverException(..) , Response(..) , ResponseEventStream , parseError - , runCollectErrs ) where import Conduit import Control.Exception (Exception(..)) -import Control.Monad.Trans.State (StateT, runStateT) -import Data.HashMap.Strict (HashMap) import Data.Sequence (Seq(..), (|>)) import qualified Data.Sequence as Seq import Data.Text (Text) import qualified Data.Text as Text -import Language.GraphQL.AST (Location(..), Name) +import Language.GraphQL.AST (Location(..)) import Language.GraphQL.Execute.Coerce -import qualified Language.GraphQL.Type.Schema as Schema import Prelude hiding (null) import Text.Megaparsec ( ParseErrorBundle(..) @@ -97,28 +91,3 @@ instance Show ResolverException where show (ResolverException e) = show e 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. -runCollectErrs :: (Monad m, Serialize a) - => HashMap Name (Schema.Type m) - -> CollectErrsT m a - -> m (Response a) -runCollectErrs types' res = do - (dat, Resolution{..}) <- runStateT res - $ 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. -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. -type CollectErrsT m = StateT (Resolution m) m