From 4ab4660d364cc62c9e23d2cdc85abc3f7dc6dc8d Mon Sep 17 00:00:00 2001 From: Danny Navarro Date: Fri, 3 Feb 2017 21:48:26 -0300 Subject: Initial implementation of AST.Full -> AST.Core This focused mainly on fragments. --- Data/GraphQL/Execute.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Data/GraphQL/Execute.hs') diff --git a/Data/GraphQL/Execute.hs b/Data/GraphQL/Execute.hs index 869753a..52537a4 100644 --- a/Data/GraphQL/Execute.hs +++ b/Data/GraphQL/Execute.hs @@ -2,7 +2,7 @@ -- according to a 'Schema'. module Data.GraphQL.Execute (execute) where -import Control.Applicative (Alternative) +import Control.Applicative (Alternative, empty) import qualified Data.List.NonEmpty as NE import Data.List.NonEmpty (NonEmpty((:|))) @@ -21,9 +21,9 @@ import qualified Data.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 - :: Alternative f + :: (Alternative f, Monad f) => Schema f -> Schema.Subs -> AST.Document -> f Aeson.Value -execute schema subs doc = document schema $ Transform.document subs doc +execute schema subs doc = document schema =<< maybe empty pure (Transform.document subs doc) document :: Alternative f => Schema f -> AST.Core.Document -> f Aeson.Value document schema (op :| [])= operation schema op -- cgit v1.2.3