diff options
| author | Danny Navarro <j@dannynavarro.net> | 2017-02-03 21:48:26 -0300 |
|---|---|---|
| committer | Danny Navarro <j@dannynavarro.net> | 2017-02-10 15:00:22 -0300 |
| commit | 4ab4660d364cc62c9e23d2cdc85abc3f7dc6dc8d (patch) | |
| tree | 4ecf1c3b4de54c7f3a5550c4e68ba8724f04273f /Data/GraphQL/Execute.hs | |
| parent | 8b09c8aa76cef5c56811a69aa0fd629186d9f9d9 (diff) | |
| download | graphql-4ab4660d364cc62c9e23d2cdc85abc3f7dc6dc8d.tar.gz | |
Initial implementation of AST.Full -> AST.Core
This focused mainly on fragments.
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 |
