| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Morpheus.Client
Synopsis
- gql :: QuasiQuoter
- class Fetch a where
- defineQuery :: IO (Eventless (Schema VALID)) -> (GQLQuery, String) -> Q [Dec]
- defineByDocument :: IO ByteString -> (GQLQuery, String) -> Q [Dec]
- defineByDocumentFile :: String -> (GQLQuery, String) -> Q [Dec]
- defineByIntrospection :: IO ByteString -> (GQLQuery, String) -> Q [Dec]
- defineByIntrospectionFile :: String -> (GQLQuery, String) -> Q [Dec]
- data ScalarValue
- class GQLScalar a where
- parseValue :: ScalarValue -> Either Text a
- serialize :: a -> ScalarValue
- scalarValidator :: Proxy a -> ScalarDefinition
- newtype ID = ID {}
Documentation
gql :: QuasiQuoter #
Minimal complete definition
defineByDocument :: IO ByteString -> (GQLQuery, String) -> Q [Dec] Source #
defineByIntrospection :: IO ByteString -> (GQLQuery, String) -> Q [Dec] Source #
data ScalarValue #
Primitive Values for GQLScalar: ScalarValue, ScalarValue, String, Boolean.
for performance reason type Text represents GraphQl String value
Instances
GraphQL Scalar
parseValue and serialize should be provided for every instances manually
Minimal complete definition
Methods
parseValue :: ScalarValue -> Either Text a #
value parsing and validating
for exhaustive pattern matching should be handled all scalar types : ScalarValue, ScalarValue, String, Boolean
invalid values can be reported with Left constructor :
parseValue String _ = Left "" -- without error message -- or parseValue String _ = Left "Error Message"
serialize :: a -> ScalarValue #
serialization of haskell type into scalar value
scalarValidator :: Proxy a -> ScalarDefinition #
Instances
| GQLScalar Bool | |
Defined in Data.Morpheus.Types.GQLScalar | |
| GQLScalar Float | |
Defined in Data.Morpheus.Types.GQLScalar | |
| GQLScalar Int | |
Defined in Data.Morpheus.Types.GQLScalar Methods parseValue :: ScalarValue -> Either Text Int # serialize :: Int -> ScalarValue # scalarValidator :: Proxy Int -> ScalarDefinition # | |
| GQLScalar Text | |
Defined in Data.Morpheus.Types.GQLScalar | |
| GQLScalar ID | |
Defined in Data.Morpheus.Types.ID Methods parseValue :: ScalarValue -> Either Text ID # serialize :: ID -> ScalarValue # scalarValidator :: Proxy ID -> ScalarDefinition # | |
Instances
| Eq ID | |
| Show ID | |
| Generic ID | |
| ToJSON ID | |
Defined in Data.Morpheus.Types.ID | |
| FromJSON ID | |
| GQLScalar ID | |
Defined in Data.Morpheus.Types.ID Methods parseValue :: ScalarValue -> Either Text ID # serialize :: ID -> ScalarValue # scalarValidator :: Proxy ID -> ScalarDefinition # | |
| type Rep ID | |
Defined in Data.Morpheus.Types.ID | |