Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class GraphQLEnum a where
- enumValues :: [Either NameError Name]
- enumFromValue :: Name -> Either Text a
- enumToValue :: a -> Name
Documentation
class GraphQLEnum a where Source #
For each enum type we need 1) a list of all possible values 2) a way to serialise and 3) deserialise.
TODO: Update this comment to explain what a GraphQLEnum is, why you might want an instance, and any laws that apply to method relations.
Nothing
enumValues :: [Either NameError Name] Source #
enumValues :: (Generic a, GenericEnumValues (Rep a)) => [Either NameError Name] Source #
enumFromValue :: Name -> Either Text a Source #
enumFromValue :: (Generic a, GenericEnumValues (Rep a)) => Name -> Either Text a Source #
enumToValue :: a -> Name Source #
enumToValue :: (Generic a, GenericEnumValues (Rep a)) => a -> Name Source #