Remove deprecated symbols from the Error module
This commit is contained in:
parent
303cf18d77
commit
e731c7db07
@ -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
|
||||||
|
- Remove deprecated `runCollectErrs`, `Resolution`, `CollectErrsT` from the
|
||||||
|
`Error` module.
|
||||||
|
|
||||||
## [1.2.0.3] - 2024-01-09
|
## [1.2.0.3] - 2024-01-09
|
||||||
### Fixed
|
### Fixed
|
||||||
- Fix corrupted source distribution.
|
- Fix corrupted source distribution.
|
||||||
@ -519,6 +524,7 @@ and this project adheres to
|
|||||||
### Added
|
### Added
|
||||||
- Data types for the GraphQL language.
|
- 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.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.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
|
[1.2.0.1]: https://git.caraus.tech/OSS/graphql/compare/v1.2.0.0...v1.2.0.1
|
||||||
|
@ -8,28 +8,22 @@
|
|||||||
|
|
||||||
-- | Error handling.
|
-- | Error handling.
|
||||||
module Language.GraphQL.Error
|
module Language.GraphQL.Error
|
||||||
( CollectErrsT
|
( Error(..)
|
||||||
, Error(..)
|
|
||||||
, Path(..)
|
, Path(..)
|
||||||
, Resolution(..)
|
|
||||||
, ResolverException(..)
|
, ResolverException(..)
|
||||||
, Response(..)
|
, Response(..)
|
||||||
, ResponseEventStream
|
, ResponseEventStream
|
||||||
, parseError
|
, parseError
|
||||||
, runCollectErrs
|
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Conduit
|
import Conduit
|
||||||
import Control.Exception (Exception(..))
|
import Control.Exception (Exception(..))
|
||||||
import Control.Monad.Trans.State (StateT, runStateT)
|
|
||||||
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
|
||||||
import Data.Text (Text)
|
import Data.Text (Text)
|
||||||
import qualified Data.Text as Text
|
import qualified Data.Text as Text
|
||||||
import Language.GraphQL.AST (Location(..), Name)
|
import Language.GraphQL.AST (Location(..))
|
||||||
import Language.GraphQL.Execute.Coerce
|
import Language.GraphQL.Execute.Coerce
|
||||||
import qualified Language.GraphQL.Type.Schema as Schema
|
|
||||||
import Prelude hiding (null)
|
import Prelude hiding (null)
|
||||||
import Text.Megaparsec
|
import Text.Megaparsec
|
||||||
( ParseErrorBundle(..)
|
( ParseErrorBundle(..)
|
||||||
@ -97,28 +91,3 @@ instance Show ResolverException where
|
|||||||
show (ResolverException e) = show e
|
show (ResolverException e) = show e
|
||||||
|
|
||||||
instance Exception ResolverException
|
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
|
|
||||||
|
Loading…
Reference in New Issue
Block a user