summaryrefslogtreecommitdiff
path: root/src/Data/GraphQL.hs
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2019-07-07 06:31:53 +0200
committerEugen Wissner <belka@caraus.de>2019-07-07 06:31:53 +0200
commit22d4a4e583d8075fc71cddc22566f41fc5a698dc (patch)
tree116b444d7b465aadf8a33a22fdd2a6db6994e7c0 /src/Data/GraphQL.hs
parent1431db7e634e5447375e1c598f4336f499384730 (diff)
downloadgraphql-22d4a4e583d8075fc71cddc22566f41fc5a698dc.tar.gz
Change the main namespace to Language.GraphQL
Diffstat (limited to 'src/Data/GraphQL.hs')
-rw-r--r--src/Data/GraphQL.hs36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/Data/GraphQL.hs b/src/Data/GraphQL.hs
deleted file mode 100644
index 47ca2b0..0000000
--- a/src/Data/GraphQL.hs
+++ /dev/null
@@ -1,36 +0,0 @@
--- | This module provides the functions to parse and execute @GraphQL@ queries.
-module Data.GraphQL where
-
-import Control.Monad (MonadPlus)
-
-import qualified Data.Text as T
-
-import qualified Data.Aeson as Aeson
-import Text.Megaparsec ( errorBundlePretty
- , parse
- )
-
-import Data.GraphQL.Execute
-import Data.GraphQL.Parser
-import Data.GraphQL.Schema
-
-import Data.GraphQL.Error
-
--- | Takes a 'Schema' and text representing a @GraphQL@ request document.
--- If the text parses correctly as a @GraphQL@ query the query is
--- executed according to the given 'Schema'.
---
--- Returns the response as an @Aeson.@'Aeson.Value'.
-graphql :: MonadPlus m => Schema m -> T.Text -> m Aeson.Value
-graphql = flip graphqlSubs $ const Nothing
-
--- | Takes a 'Schema', a variable substitution function and text
--- representing a @GraphQL@ request document. If the text parses
--- correctly as a @GraphQL@ query the substitution is applied to the
--- query and the query is then executed according to the given 'Schema'.
---
--- Returns the response as an @Aeson.@'Aeson.Value'.
-graphqlSubs :: MonadPlus m => Schema m -> Subs -> T.Text -> m Aeson.Value
-graphqlSubs schema f =
- either (parseError . errorBundlePretty) (execute schema f)
- . parse document ""