summaryrefslogtreecommitdiff
path: root/Data
diff options
context:
space:
mode:
authorDanny Navarro <j@dannynavarro.net>2015-09-18 15:02:51 +0200
committerDanny Navarro <j@dannynavarro.net>2015-09-18 15:02:51 +0200
commitd88acf3d0e8f9b9d5345477b23e329cefec89b6f (patch)
tree4c460cf0955ae9a5b7b002a08696740cd9396d15 /Data
parentc9c1137cebe5629f145f55fc941cb09ce7b3d02a (diff)
downloadgraphql-d88acf3d0e8f9b9d5345477b23e329cefec89b6f.tar.gz
Refine numeric types
Diffstat (limited to 'Data')
-rw-r--r--Data/GraphQL/AST.hs4
-rw-r--r--Data/GraphQL/Parser.hs1
2 files changed, 3 insertions, 2 deletions
diff --git a/Data/GraphQL/AST.hs b/Data/GraphQL/AST.hs
index 422ce9e..7e8c9b5 100644
--- a/Data/GraphQL/AST.hs
+++ b/Data/GraphQL/AST.hs
@@ -1,5 +1,6 @@
module Data.GraphQL.AST where
+import Data.Int (Int32)
import Data.Text (Text)
-- * Name
@@ -61,7 +62,8 @@ type TypeCondition = NamedType
-- * Values
data Value = ValueVariable Variable
- | ValueInt Int
+ | ValueInt Int32
+ -- GraphQL Float is double precison
| ValueFloat Double
| ValueBoolean Bool
| ValueString Text
diff --git a/Data/GraphQL/Parser.hs b/Data/GraphQL/Parser.hs
index fa8c532..99700c0 100644
--- a/Data/GraphQL/Parser.hs
+++ b/Data/GraphQL/Parser.hs
@@ -150,7 +150,6 @@ value :: Parser Value
value = ValueVariable <$> variable
-- TODO: Handle maxBound, Int32 in spec.
<|> ValueInt <$> tok (signed decimal)
- -- There is a stock `parser` for double but not for float.
<|> ValueFloat <$> tok (signed double)
<|> ValueBoolean <$> bool
-- TODO: Handle escape characters, unicode, etc