summaryrefslogtreecommitdiff
path: root/Data/GraphQL/Execute.hs
diff options
context:
space:
mode:
authorDanny Navarro <j@dannynavarro.net>2016-02-09 13:31:28 +0100
committerDanny Navarro <j@dannynavarro.net>2016-02-09 13:31:28 +0100
commitdf8e43c9aa922ff8f3ce1bf560c4286012486907 (patch)
tree3f57dc5aec598c08ccf80a329859edd4b7d1aa16 /Data/GraphQL/Execute.hs
parentc385566912c8f4b2c4e852d1a560ac4ce5f9258a (diff)
downloadgraphql-df8e43c9aa922ff8f3ce1bf560c4286012486907.tar.gz
Handle Output enumerations in Schema definition
The third end-to-end test from graphql-js was implemented.
Diffstat (limited to 'Data/GraphQL/Execute.hs')
-rw-r--r--Data/GraphQL/Execute.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/Data/GraphQL/Execute.hs b/Data/GraphQL/Execute.hs
index df6b506..0586a2e 100644
--- a/Data/GraphQL/Execute.hs
+++ b/Data/GraphQL/Execute.hs
@@ -33,6 +33,9 @@ selection _ _ = error "selection: Not implemented yet"
output :: (Alternative f, Monad f) => SelectionSet -> Output f -> f Aeson.Value
output sels (OutputResolver resolv) = selectionSet resolv sels
output sels (OutputList os) = fmap array . traverse (output sels) =<< os
+output sels (OutputEnum e)
+ | null sels = Aeson.toJSON <$> e
+ | otherwise = empty
output sels (OutputScalar s)
| null sels = Aeson.toJSON <$> s
| otherwise = empty