-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Morpheus GraphQL Client -- -- Build GraphQL APIs with your favourite functional language! @package morpheus-graphql-client @version 0.19.2 module Data.Morpheus.Client gql :: QuasiQuoter class Fetch a where { type family Args a :: *; } __fetch :: (Fetch a, Monad m, Show a, ToJSON (Args a), FromJSON a) => String -> FieldName -> (ByteString -> m ByteString) -> Args a -> m (Either (FetchError a) a) fetch :: (Fetch a, Monad m, FromJSON a) => (ByteString -> m ByteString) -> Args a -> m (Either (FetchError a) a) data FetchError a FetchErrorParseFailure :: String -> FetchError a FetchErrorProducedErrors :: GQLErrors -> Maybe a -> FetchError a FetchErrorNoResult :: FetchError a defineQuery :: IO (GQLResult (Schema VALID)) -> (ExecutableDocument, String) -> Q [Dec] defineByDocument :: IO ByteString -> (ExecutableDocument, String) -> Q [Dec] defineByDocumentFile :: FilePath -> (ExecutableDocument, String) -> Q [Dec] -- | This variant exposes 'Q FilePath' enabling the use of TH to generate -- the FilePath. For example, -- https://hackage.haskell.org/package/file-embed-0.0.13.0/docs/Data-FileEmbed.html#v:makeRelativeToProject -- can be used to handle multi package projects more reliably. defineByDocumentFile' :: Q FilePath -> (ExecutableDocument, String) -> Q [Dec] defineByIntrospection :: IO ByteString -> (ExecutableDocument, String) -> Q [Dec] defineByIntrospectionFile :: FilePath -> (ExecutableDocument, String) -> Q [Dec] -- | This variant exposes 'Q FilePath' enabling the use of TH to generate -- the FilePath. For example, -- https://hackage.haskell.org/package/file-embed-0.0.13.0/docs/Data-FileEmbed.html#v:makeRelativeToProject -- can be used to handle multi package projects more reliably. defineByIntrospectionFile' :: Q FilePath -> (ExecutableDocument, String) -> Q [Dec] -- | Primitive Values for GQLScalar: Int, Float, -- String, Boolean. for performance reason type Text -- represents GraphQl String value data ScalarValue Int :: Int -> ScalarValue Float :: Double -> ScalarValue String :: Text -> ScalarValue Boolean :: Bool -> ScalarValue Value :: Value -> ScalarValue -- | GraphQL Scalar parser class DecodeScalar a decodeScalar :: DecodeScalar a => ScalarValue -> Either Text a -- | GraphQL Scalar Serializer class EncodeScalar a encodeScalar :: EncodeScalar a => a -> ScalarValue -- | default GraphQL type, parses only String and Int values, -- serialized always as String newtype ID ID :: Text -> ID [unpackID] :: ID -> Text