diff options
| author | Eugen Wissner <belka@caraus.de> | 2020-05-14 09:17:14 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2020-05-14 22:16:56 +0200 |
| commit | a5c44f30facdaabd94ed25953a3bd88005efa868 (patch) | |
| tree | bf768b92b5b3ecab5c939d04bf4ec6ebdb7e5257 /src/Language/GraphQL.hs | |
| parent | 4c19c88e98bea77ebccc786cd55b30e23ab6e897 (diff) | |
| download | graphql-a5c44f30facdaabd94ed25953a3bd88005efa868.tar.gz | |
Add basic output object type support
Diffstat (limited to 'src/Language/GraphQL.hs')
| -rw-r--r-- | src/Language/GraphQL.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Language/GraphQL.hs b/src/Language/GraphQL.hs index 73f9bdc..fff378d 100644 --- a/src/Language/GraphQL.hs +++ b/src/Language/GraphQL.hs @@ -5,19 +5,18 @@ module Language.GraphQL ) where import qualified Data.Aeson as Aeson -import Data.List.NonEmpty (NonEmpty) -import Data.HashMap.Strict (HashMap) import Data.Text (Text) import Language.GraphQL.Error import Language.GraphQL.Execute import Language.GraphQL.AST.Parser import qualified Language.GraphQL.Schema as Schema +import Language.GraphQL.Type.Schema import Text.Megaparsec (parse) -- | If the text parses correctly as a @GraphQL@ query the query is -- executed using the given 'Schema.Resolver's. graphql :: Monad m - => HashMap Text (NonEmpty (Schema.Resolver m)) -- ^ Resolvers. + => Schema m -- ^ Resolvers. -> Text -- ^ Text representing a @GraphQL@ request document. -> m Aeson.Value -- ^ Response. graphql = flip graphqlSubs mempty @@ -26,7 +25,7 @@ graphql = flip graphqlSubs mempty -- applied to the query and the query is then executed using to the given -- 'Schema.Resolver's. graphqlSubs :: Monad m - => HashMap Text (NonEmpty (Schema.Resolver m)) -- ^ Resolvers. + => Schema m -- ^ Resolvers. -> Schema.Subs -- ^ Variable substitution function. -> Text -- ^ Text representing a @GraphQL@ request document. -> m Aeson.Value -- ^ Response. |
