summaryrefslogtreecommitdiff
path: root/Data/GraphQL/Execute.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Data/GraphQL/Execute.hs')
-rw-r--r--Data/GraphQL/Execute.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/Data/GraphQL/Execute.hs b/Data/GraphQL/Execute.hs
index 413a3cb..3d60bef 100644
--- a/Data/GraphQL/Execute.hs
+++ b/Data/GraphQL/Execute.hs
@@ -32,7 +32,9 @@ document schema (op :| []) = operation schema op
document _ _ = error "Multiple operations not supported yet"
operation :: Alternative f => Schema f -> AST.Core.Operation -> f Aeson.Value
-operation schema (AST.Core.Query flds) =
- Aeson.Object . HashMap.singleton "data"
- <$> Schema.resolve (NE.toList schema) (NE.toList flds)
-operation _ _ = error "Mutations not supported yet"
+operation schema (AST.Core.Query flds)
+ = Aeson.Object . HashMap.singleton "data"
+ <$> Schema.resolve (NE.toList schema) (NE.toList flds)
+operation schema (AST.Core.Mutation flds)
+ = Aeson.Object . HashMap.singleton "data"
+ <$> Schema.resolve (NE.toList schema) (NE.toList flds)