forked from OSS/graphql
Remove deprecated Error functions
This commit is contained in:
parent
a2401d563b
commit
0d25f482dd
@ -6,6 +6,11 @@ The format is based on
|
|||||||
and this project adheres to
|
and this project adheres to
|
||||||
[Haskell Package Versioning Policy](https://pvp.haskell.org/).
|
[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
|
## [1.0.3.0] - 2022-03-27
|
||||||
### Fixed
|
### Fixed
|
||||||
- Index position in error path. (Index and Segment paths of a field have been
|
- Index position in error path. (Index and Segment paths of a field have been
|
||||||
@ -477,6 +482,7 @@ and this project adheres to
|
|||||||
### Added
|
### Added
|
||||||
- Data types for the GraphQL language.
|
- 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.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.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
|
[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
|
||||||
|
@ -11,7 +11,7 @@ author: Danny Navarro <j@dannynavarro.net>,
|
|||||||
Matthías Páll Gissurarson <mpg@mpg.is>,
|
Matthías Páll Gissurarson <mpg@mpg.is>,
|
||||||
Sólrún Halla Einarsdóttir <she@mpg.is>
|
Sólrún Halla Einarsdóttir <she@mpg.is>
|
||||||
maintainer: belka@caraus.de
|
maintainer: belka@caraus.de
|
||||||
copyright: (c) 2019-2021 Eugen Wissner,
|
copyright: (c) 2019-2022 Eugen Wissner,
|
||||||
(c) 2015-2017 J. Daniel Navarro
|
(c) 2015-2017 J. Daniel Navarro
|
||||||
license: MPL-2.0 AND BSD-3-Clause
|
license: MPL-2.0 AND BSD-3-Clause
|
||||||
license-files: LICENSE,
|
license-files: LICENSE,
|
||||||
|
@ -15,16 +15,13 @@ module Language.GraphQL.Error
|
|||||||
, ResolverException(..)
|
, ResolverException(..)
|
||||||
, Response(..)
|
, Response(..)
|
||||||
, ResponseEventStream
|
, ResponseEventStream
|
||||||
, addErr
|
|
||||||
, addErrMsg
|
|
||||||
, parseError
|
, parseError
|
||||||
, runCollectErrs
|
, runCollectErrs
|
||||||
, singleError
|
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Conduit
|
import Conduit
|
||||||
import Control.Exception (Exception(..))
|
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.HashMap.Strict (HashMap)
|
||||||
import Data.Sequence (Seq(..), (|>))
|
import Data.Sequence (Seq(..), (|>))
|
||||||
import qualified Data.Sequence as 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
|
-- /CollectErrsT was part of the old executor and isn't used anymore, it will be
|
||||||
-- deprecated in the future and removed./
|
-- deprecated in the future and removed./
|
||||||
type CollectErrsT m = StateT (Resolution m) m
|
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
|
|
||||||
|
Loading…
Reference in New Issue
Block a user