diff options
| author | Danny Navarro <j@dannynavarro.net> | 2017-01-29 18:44:03 -0300 |
|---|---|---|
| committer | Danny Navarro <j@dannynavarro.net> | 2017-02-02 12:44:03 -0300 |
| commit | 693b7d18dcd48525b10ce297f89b3b33fd020784 (patch) | |
| tree | a8ee10c9442485b152084ec395044a2001b1477f /Data/GraphQL/Execute.hs | |
| parent | f35e1f949ab3ee718ab773baf9f38ac411d49a28 (diff) | |
| download | graphql-693b7d18dcd48525b10ce297f89b3b33fd020784.tar.gz | |
Introduce Tranform module
In the Transform module the Full AST will converted to Core AST.
This commit also includes a partial implementation of Fragment replacement.
Diffstat (limited to 'Data/GraphQL/Execute.hs')
| -rw-r--r-- | Data/GraphQL/Execute.hs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/Data/GraphQL/Execute.hs b/Data/GraphQL/Execute.hs index 561bf20..869753a 100644 --- a/Data/GraphQL/Execute.hs +++ b/Data/GraphQL/Execute.hs @@ -10,17 +10,10 @@ import qualified Data.Aeson as Aeson import qualified Data.GraphQL.AST as AST import qualified Data.GraphQL.AST.Core as AST.Core +import qualified Data.GraphQL.AST.Transform as Transform import Data.GraphQL.Schema (Schema) import qualified Data.GraphQL.Schema as Schema - - -core :: Schema.Subs -> AST.Document -> AST.Core.Document -core subs ((AST.DefinitionOperation opDef) :| []) = error "Not implemented yet" -core _ ((AST.DefinitionFragment fragDef) :| []) = - error "Fragment definitions not supported yet" -core _ _ = error "Multiple definitions not supported yet" - -- | Takes a 'Schema', a variable substitution function ('Schema.Subs'), and a -- @GraphQL@ 'document'. The substitution is applied to the document using -- 'rootFields', and the 'Schema''s resolvers are applied to the resulting fields. @@ -30,7 +23,7 @@ core _ _ = error "Multiple definitions not supported yet" execute :: Alternative f => Schema f -> Schema.Subs -> AST.Document -> f Aeson.Value -execute schema subs doc = document schema $ core subs doc +execute schema subs doc = document schema $ Transform.document subs doc document :: Alternative f => Schema f -> AST.Core.Document -> f Aeson.Value document schema (op :| [])= operation schema op |
