summaryrefslogtreecommitdiff
path: root/src/Language/GraphQL/Execute.hs
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2020-02-01 20:46:35 +0100
committerEugen Wissner <belka@caraus.de>2020-02-01 20:46:35 +0100
commit67bebf853ca5a248358ea1854124a46b70c677cd (patch)
treeb103bf025a1d0f48c2524dd3c2237ff13fd99ec5 /src/Language/GraphQL/Execute.hs
parente8b82122c646ba159146c986cc8983d66f790142 (diff)
downloadgraphql-67bebf853ca5a248358ea1854124a46b70c677cd.tar.gz
Replace MonadIO constraint with just Monad
And make the tests use Identity instead of IO.
Diffstat (limited to 'src/Language/GraphQL/Execute.hs')
-rw-r--r--src/Language/GraphQL/Execute.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Language/GraphQL/Execute.hs b/src/Language/GraphQL/Execute.hs
index 5278606..de937ee 100644
--- a/src/Language/GraphQL/Execute.hs
+++ b/src/Language/GraphQL/Execute.hs
@@ -6,7 +6,6 @@ module Language.GraphQL.Execute
, executeWithName
) where
-import Control.Monad.IO.Class (MonadIO)
import qualified Data.Aeson as Aeson
import Data.Foldable (toList)
import Data.List.NonEmpty (NonEmpty(..))
@@ -24,7 +23,7 @@ import qualified Language.GraphQL.Schema as Schema
--
-- Returns the result of the query against the schema wrapped in a /data/
-- field, or errors wrapped in an /errors/ field.
-execute :: MonadIO m
+execute :: Monad m
=> NonEmpty (Schema.Resolver m) -- ^ Resolvers.
-> Schema.Subs -- ^ Variable substitution function.
-> Document -- @GraphQL@ document.
@@ -40,7 +39,7 @@ execute schema subs doc =
--
-- Returns the result of the query against the schema wrapped in a /data/
-- field, or errors wrapped in an /errors/ field.
-executeWithName :: MonadIO m
+executeWithName :: Monad m
=> NonEmpty (Schema.Resolver m) -- ^ Resolvers
-> Text -- ^ Operation name.
-> Schema.Subs -- ^ Variable substitution function.
@@ -51,7 +50,7 @@ executeWithName schema name subs doc =
where
transformError = return $ singleError "Schema transformation error."
-document :: MonadIO m
+document :: Monad m
=> NonEmpty (Schema.Resolver m)
-> Maybe Text
-> AST.Core.Document
@@ -67,7 +66,7 @@ document schema (Just name) operations = case NE.dropWhile matchingName operatio
matchingName _ = False
document _ _ _ = return $ singleError "Missing operation name."
-operation :: MonadIO m
+operation :: Monad m
=> NonEmpty (Schema.Resolver m)
-> AST.Core.Operation
-> m Aeson.Value