From 5954962de133ed45b49fdc831685ab6f602261ad Mon Sep 17 00:00:00 2001 From: Danny Navarro Date: Wed, 1 Mar 2017 21:04:35 -0300 Subject: [PATCH] Make alternate Schema functions work with AST.Core --- Data/GraphQL/Schema.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Data/GraphQL/Schema.hs b/Data/GraphQL/Schema.hs index d11a637..2646bac 100644 --- a/Data/GraphQL/Schema.hs +++ b/Data/GraphQL/Schema.hs @@ -76,9 +76,9 @@ object' name resolvs = objectA' name $ \case objectA' :: (Alternative f, Monad f) => Text -> ([Argument] -> f [Resolver f]) -> Resolver f -objectA' name f fld@(Field _ _ args _ sels) = do +objectA' name f fld@(Field _ _ args flds) = do resolvs <- f args - withField name (resolvers resolvs $ fields sels) fld + withField name (resolve resolvs flds) fld -- | A scalar represents a primitive value, like a string or an integer. @@ -116,9 +116,9 @@ array' name resolvs = arrayA' name $ \case arrayA' :: (Alternative f, Monad f) => Text -> ([Argument] -> f [[Resolver f]]) -> Resolver f -arrayA' name f fld@(Field _ _ args _ sels) = do +arrayA' name f fld@(Field _ _ args sels) = do resolvs <- f args - withField name (joinErrs $ traverse (flip resolvers $ fields sels) $ resolvs) fld + withField name (traverse (`resolve` sels) resolvs) fld -- | Represents one of a finite set of possible values. -- Used in place of a 'scalar' when the possible responses are easily enumerable.