summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Data/GraphQL/Parser.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Data/GraphQL/Parser.hs b/Data/GraphQL/Parser.hs
index 013dd9b..42f52a0 100644
--- a/Data/GraphQL/Parser.hs
+++ b/Data/GraphQL/Parser.hs
@@ -73,7 +73,10 @@ variableDefinition :: Parser VariableDefinition
variableDefinition =
VariableDefinition <$> variable <* s <* ":" <* s
<*> type_ <* s
- <*> value
+ <*> (defaultValue <|> empty)
+
+defaultValue :: Parser DefaultValue
+defaultValue = "=" *> s *> value
-- In defense of good taste, I'm taking liberty of not allowing space between
-- '$' and the 'name' even though that's not in the spec.
@@ -248,6 +251,7 @@ unionTypeDefinition :: Parser UnionTypeDefinition
unionTypeDefinition = UnionTypeDefinition
<$ "union" <* s1
<*> name <* s
+ <* "=" <* s
<*> unionMembers
where
-- This should take care of standalone `NamedType`