diff options
Diffstat (limited to 'Data/GraphQL/Execute.hs')
| -rw-r--r-- | Data/GraphQL/Execute.hs | 6 |
1 files changed, 3 insertions, 3 deletions
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 |
