forked from OSS/graphql
Refine numeric types
This commit is contained in:
parent
c9c1137ceb
commit
d88acf3d0e
@ -1,5 +1,6 @@
|
|||||||
module Data.GraphQL.AST where
|
module Data.GraphQL.AST where
|
||||||
|
|
||||||
|
import Data.Int (Int32)
|
||||||
import Data.Text (Text)
|
import Data.Text (Text)
|
||||||
|
|
||||||
-- * Name
|
-- * Name
|
||||||
@ -61,7 +62,8 @@ type TypeCondition = NamedType
|
|||||||
-- * Values
|
-- * Values
|
||||||
|
|
||||||
data Value = ValueVariable Variable
|
data Value = ValueVariable Variable
|
||||||
| ValueInt Int
|
| ValueInt Int32
|
||||||
|
-- GraphQL Float is double precison
|
||||||
| ValueFloat Double
|
| ValueFloat Double
|
||||||
| ValueBoolean Bool
|
| ValueBoolean Bool
|
||||||
| ValueString Text
|
| ValueString Text
|
||||||
|
@ -150,7 +150,6 @@ value :: Parser Value
|
|||||||
value = ValueVariable <$> variable
|
value = ValueVariable <$> variable
|
||||||
-- TODO: Handle maxBound, Int32 in spec.
|
-- TODO: Handle maxBound, Int32 in spec.
|
||||||
<|> ValueInt <$> tok (signed decimal)
|
<|> ValueInt <$> tok (signed decimal)
|
||||||
-- There is a stock `parser` for double but not for float.
|
|
||||||
<|> ValueFloat <$> tok (signed double)
|
<|> ValueFloat <$> tok (signed double)
|
||||||
<|> ValueBoolean <$> bool
|
<|> ValueBoolean <$> bool
|
||||||
-- TODO: Handle escape characters, unicode, etc
|
-- TODO: Handle escape characters, unicode, etc
|
||||||
|
Loading…
Reference in New Issue
Block a user