diff options
| author | Eugen Wissner <belka@caraus.de> | 2021-07-02 09:28:03 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2021-07-02 09:28:03 +0200 |
| commit | b99bb722722b8d7a40445a3e8af7b6b3f09cf770 (patch) | |
| tree | 5ddafd033acbd0f9a048253a681384b3554876d5 /src/Language/GraphQL/Execute/Internal.hs | |
| parent | b580d1a98880749c1473c11b790d3ec622fe00ad (diff) | |
| download | graphql-b99bb722722b8d7a40445a3e8af7b6b3f09cf770.tar.gz | |
Report subscription error locations
Diffstat (limited to 'src/Language/GraphQL/Execute/Internal.hs')
| -rw-r--r-- | src/Language/GraphQL/Execute/Internal.hs | 14 |
1 files changed, 4 insertions, 10 deletions
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 [] |
