From b99bb722722b8d7a40445a3e8af7b6b3f09cf770 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Fri, 2 Jul 2021 09:28:03 +0200 Subject: Report subscription error locations --- src/Language/GraphQL/Execute/Internal.hs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/Language/GraphQL/Execute/Internal.hs') diff --git a/src/Language/GraphQL/Execute/Internal.hs b/src/Language/GraphQL/Execute/Internal.hs index 7e4e4a9..046db45 100644 --- a/src/Language/GraphQL/Execute/Internal.hs +++ b/src/Language/GraphQL/Execute/Internal.hs @@ -15,13 +15,8 @@ import Control.Monad.Trans.State (modify) import Control.Monad.Catch (MonadCatch) import Data.Sequence ((|>)) import qualified Data.Text as Text -import Language.GraphQL.Execute.Coerce -import Language.GraphQL.Error - ( CollectErrsT - , Error(..) - , Resolution(..) - , Response(..) - ) +import qualified Language.GraphQL.AST as Full +import Language.GraphQL.Error (CollectErrsT, Error(..), Resolution(..)) import Prelude hiding (null) addError :: MonadCatch m => forall a. a -> Error -> CollectErrsT m a @@ -32,6 +27,5 @@ addError returnValue error' = modify appender >> pure returnValue { errors = errors |> error' } -singleError :: Serialize b => forall a. String -> Either a (Response b) -singleError message = - Right $ Response null $ pure $ Error (Text.pack message) [] [] +singleError :: [Full.Location] -> String -> Error +singleError errorLocations message = Error (Text.pack message) errorLocations [] -- cgit v1.2.3