-
-
Notifications
You must be signed in to change notification settings - Fork 63
Scalar Type
nalchevanidze edited this page May 16, 2019
·
2 revisions
To use custom scalar types, you need to provide implementations for parseValue
and serialize
respectively and
associate them with ENUM
type.
type instance KIND Euro = SCALAR
data Euro = Euro Int Int deriving (Generic, GQLType)
instance GQLScalar Odd where
parseValue (Int x) = pure $ Euro (... )
parseValue (String x) = pure $ Euro (... )
serialize (Euro euro cent) = Int (euro * 100) ++ cent