From 0d25f482dd33a71b93166b5fb0e6ac9de4a27eac Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Thu, 31 Mar 2022 21:49:44 +0200 Subject: [PATCH] Remove deprecated Error functions --- CHANGELOG.md | 6 ++++++ graphql.cabal | 2 +- src/Language/GraphQL/Error.hs | 28 +--------------------------- 3 files changed, 8 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69663e9..ff33b3c 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 +- Removed deprecated `Language.GraphQL.Error` functions: `addErr`, `addErrMsg`, + `singleError`. + ## [1.0.3.0] - 2022-03-27 ### Fixed - Index position in error path. (Index and Segment paths of a field have been @@ -477,6 +482,7 @@ and this project adheres to ### Added - Data types for the GraphQL language. +[Unreleased]: https://www.caraus.tech/projects/pub-graphql/repository/23/diff?rev=master&rev_to=v1.0.3.0 [1.0.3.0]: https://www.caraus.tech/projects/pub-graphql/repository/23/diff?rev=1.0.3.0&rev_to=v1.0.2.0 [1.0.2.0]: https://www.caraus.tech/projects/pub-graphql/repository/23/diff?rev=1.0.2.0&rev_to=v1.0.1.0 [1.0.1.0]: https://www.caraus.tech/projects/pub-graphql/repository/23/diff?rev=v1.0.1.0&rev_to=v1.0.0.0 diff --git a/graphql.cabal b/graphql.cabal index c50029e..073b4db 100644 --- a/graphql.cabal +++ b/graphql.cabal @@ -11,7 +11,7 @@ author: Danny Navarro , Matthías Páll Gissurarson , Sólrún Halla Einarsdóttir maintainer: belka@caraus.de -copyright: (c) 2019-2021 Eugen Wissner, +copyright: (c) 2019-2022 Eugen Wissner, (c) 2015-2017 J. Daniel Navarro license: MPL-2.0 AND BSD-3-Clause license-files: LICENSE, diff --git a/src/Language/GraphQL/Error.hs b/src/Language/GraphQL/Error.hs index 4e461f0..ffd3a78 100644 --- a/src/Language/GraphQL/Error.hs +++ b/src/Language/GraphQL/Error.hs @@ -15,16 +15,13 @@ module Language.GraphQL.Error , ResolverException(..) , Response(..) , ResponseEventStream - , addErr - , addErrMsg , parseError , runCollectErrs - , singleError ) where import Conduit import Control.Exception (Exception(..)) -import Control.Monad.Trans.State (StateT, modify, runStateT) +import Control.Monad.Trans.State (StateT, runStateT) import Data.HashMap.Strict (HashMap) import Data.Sequence (Seq(..), (|>)) import qualified Data.Sequence as Seq @@ -131,26 +128,3 @@ data Resolution m = Resolution -- /CollectErrsT was part of the old executor and isn't used anymore, it will be -- deprecated in the future and removed./ type CollectErrsT m = StateT (Resolution m) m - --- | Adds an error to the list of errors. -{-# DEPRECATED #-} -addErr :: Monad m => Error -> CollectErrsT m () -addErr v = modify appender - where - appender :: Monad m => Resolution m -> Resolution m - appender resolution@Resolution{..} = resolution{ errors = errors |> v } - -{-# DEPRECATED #-} -makeErrorMessage :: Text -> Error -makeErrorMessage s = Error s [] [] - --- | Constructs a response object containing only the error with the given --- message. -{-# DEPRECATED #-} -singleError :: Serialize a => Text -> Response a -singleError message = Response null $ Seq.singleton $ Error message [] [] - --- | Convenience function for just wrapping an error message. -{-# DEPRECATED #-} -addErrMsg :: (Monad m, Serialize a) => Text -> CollectErrsT m a -addErrMsg errorMessage = (addErr . makeErrorMessage) errorMessage >> pure null