morpheus-graphql-0.8.0: Morpheus GraphQL

Safe HaskellNone
LanguageHaskell2010

Data.Morpheus.Types

Description

GQL Types

Synopsis

Documentation

data Event e c Source #

Constructors

Event 

Fields

class IsObject (KIND a) => GQLType a where Source #

Minimal complete definition

Nothing

Associated Types

type KIND a :: GQL_KIND Source #

Instances
GQLType Bool Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND Bool :: GQL_KIND Source #

type CUSTOM Bool :: Bool

GQLType Float Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND Float :: GQL_KIND Source #

type CUSTOM Float :: Bool

GQLType Int Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND Int :: GQL_KIND Source #

type CUSTOM Int :: Bool

GQLType () Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND () :: GQL_KIND Source #

type CUSTOM () :: Bool

GQLType Text Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND Text :: GQL_KIND Source #

type CUSTOM Text :: Bool

GQLType ID Source # 
Instance details

Defined in Data.Morpheus.Types.ID

Associated Types

type KIND ID :: GQL_KIND Source #

type CUSTOM ID :: Bool

GQLType a => GQLType [a] Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND [a] :: GQL_KIND Source #

type CUSTOM [a] :: Bool

GQLType a => GQLType (Maybe a) Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND (Maybe a) :: GQL_KIND Source #

type CUSTOM (Maybe a) :: Bool

GQLType a => GQLType (Set a) Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND (Set a) :: GQL_KIND Source #

type CUSTOM (Set a) :: Bool

Typeable m => GQLType (Undefined m) Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND (Undefined m) :: GQL_KIND Source #

type CUSTOM (Undefined m) :: Bool

GQLType b => GQLType (a -> b) Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND (a -> b) :: GQL_KIND Source #

type CUSTOM (a -> b) :: Bool

Methods

description :: Proxy (a -> b) -> Maybe Text Source #

isObjectKind :: Proxy (a -> b) -> Bool

__typeName :: Proxy (a -> b) -> Text

__typeFingerprint :: Proxy (a -> b) -> DataFingerprint

GQLType a => GQLType (Either s a) Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND (Either s a) :: GQL_KIND Source #

type CUSTOM (Either s a) :: Bool

(Typeable a, Typeable b, GQLType a, GQLType b) => GQLType (a, b) Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND (a, b) :: GQL_KIND Source #

type CUSTOM (a, b) :: Bool

(Typeable k, Typeable v) => GQLType (Map k v) Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND (Map k v) :: GQL_KIND Source #

type CUSTOM (Map k v) :: Bool

GQLType a => GQLType (Resolver o e m a) Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND (Resolver o e m a) :: GQL_KIND Source #

type CUSTOM (Resolver o e m a) :: Bool

class GQLScalar a where Source #

GraphQL Scalar

parseValue and serialize should be provided for every instances manually

Methods

parseValue :: ScalarValue -> Either Text a Source #

value parsing and validating

for exhaustive pattern matching should be handled all scalar types : ScalarValue, ScalarValue, ScalarValue, Boolean

invalid values can be reported with Left constructor :

  parseValue String _ = Left "" -- without error message
  -- or
  parseValue String _ = Left "Error Message"

serialize :: a -> ScalarValue Source #

serialization of haskell type into scalar value

data GQLRequest Source #

GraphQL HTTP Request Body

Constructors

GQLRequest 
Instances
Show GQLRequest Source # 
Instance details

Defined in Data.Morpheus.Types.IO

Generic GQLRequest Source # 
Instance details

Defined in Data.Morpheus.Types.IO

Associated Types

type Rep GQLRequest :: Type -> Type #

ToJSON GQLRequest Source # 
Instance details

Defined in Data.Morpheus.Types.IO

FromJSON GQLRequest Source # 
Instance details

Defined in Data.Morpheus.Types.IO

Interpreter (GQLRequest -> m GQLResponse) m e Source # 
Instance details

Defined in Data.Morpheus.Execution.Server.Interpreter

Methods

interpreter :: (Monad m, RootResCon m e query mut sub) => GQLRootResolver m e query mut sub -> GQLRequest -> m GQLResponse Source #

type Rep GQLRequest Source # 
Instance details

Defined in Data.Morpheus.Types.IO

type Rep GQLRequest = D1 (MetaData "GQLRequest" "Data.Morpheus.Types.IO" "morpheus-graphql-0.8.0-GqQbC5VkuucF3CVtmsv1IY" False) (C1 (MetaCons "GQLRequest" PrefixI True) (S1 (MetaSel (Just "query") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Key) :*: (S1 (MetaSel (Just "operationName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Key)) :*: S1 (MetaSel (Just "variables") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Value)))))

data GQLResponse Source #

GraphQL Response

Constructors

Data ValidValue 
Errors [GQLError] 
Instances
Show GQLResponse Source # 
Instance details

Defined in Data.Morpheus.Types.IO

Generic GQLResponse Source # 
Instance details

Defined in Data.Morpheus.Types.IO

Associated Types

type Rep GQLResponse :: Type -> Type #

ToJSON GQLResponse Source # 
Instance details

Defined in Data.Morpheus.Types.IO

FromJSON GQLResponse Source # 
Instance details

Defined in Data.Morpheus.Types.IO

Interpreter (GQLRequest -> m GQLResponse) m e Source # 
Instance details

Defined in Data.Morpheus.Execution.Server.Interpreter

Methods

interpreter :: (Monad m, RootResCon m e query mut sub) => GQLRootResolver m e query mut sub -> GQLRequest -> m GQLResponse Source #

type Rep GQLResponse Source # 
Instance details

Defined in Data.Morpheus.Types.IO

newtype ID Source #

default GraphQL type, parses only ScalarValue and ScalarValue values, serialized always as ScalarValue

Constructors

ID 

Fields

Instances
Show ID Source # 
Instance details

Defined in Data.Morpheus.Types.ID

Methods

showsPrec :: Int -> ID -> ShowS #

show :: ID -> String #

showList :: [ID] -> ShowS #

Generic ID Source # 
Instance details

Defined in Data.Morpheus.Types.ID

Associated Types

type Rep ID :: Type -> Type #

Methods

from :: ID -> Rep ID x #

to :: Rep ID x -> ID #

GQLScalar ID Source # 
Instance details

Defined in Data.Morpheus.Types.ID

GQLType ID Source # 
Instance details

Defined in Data.Morpheus.Types.ID

Associated Types

type KIND ID :: GQL_KIND Source #

type CUSTOM ID :: Bool

type Rep ID Source # 
Instance details

Defined in Data.Morpheus.Types.ID

type Rep ID = D1 (MetaData "ID" "Data.Morpheus.Types.ID" "morpheus-graphql-0.8.0-GqQbC5VkuucF3CVtmsv1IY" True) (C1 (MetaCons "ID" PrefixI True) (S1 (MetaSel (Just "unpackID") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))
type KIND ID Source # 
Instance details

Defined in Data.Morpheus.Types.ID

type KIND ID = SCALAR

data ScalarValue Source #

Primitive Values for GQLScalar: ScalarValue, ScalarValue, ScalarValue, Boolean. for performance reason type Text represents GraphQl ScalarValue value

Instances
Show ScalarValue Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Value

Generic ScalarValue Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Value

Associated Types

type Rep ScalarValue :: Type -> Type #

Lift ScalarValue Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Value

Methods

lift :: ScalarValue -> Q Exp #

ToJSON ScalarValue Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Value

FromJSON ScalarValue Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Value

type Rep ScalarValue Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Value

data GQLRootResolver (m :: * -> *) event (query :: (* -> *) -> *) (mut :: (* -> *) -> *) (sub :: (* -> *) -> *) Source #

GraphQL Root resolver, also the interpreter generates a GQL schema from it. queryResolver is required, mutationResolver and subscriptionResolver are optional, if your schema does not supports mutation or subscription , you acn use () for it.

Constructors

GQLRootResolver 

Fields

constRes :: (LiftEither o Resolver, Monad m) => b -> a -> Resolver o e m b Source #

constMutRes :: Monad m => [e] -> a -> args -> MutRes e m a Source #

data Undefined (m :: * -> *) Source #

Constructors

Undefined 
Instances
Show (Undefined m) Source # 
Instance details

Defined in Data.Morpheus.Types.Types

Generic (Undefined m) Source # 
Instance details

Defined in Data.Morpheus.Types.Types

Associated Types

type Rep (Undefined m) :: Type -> Type #

Methods

from :: Undefined m -> Rep (Undefined m) x #

to :: Rep (Undefined m) x -> Undefined m #

Typeable m => GQLType (Undefined m) Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND (Undefined m) :: GQL_KIND Source #

type CUSTOM (Undefined m) :: Bool

type Rep (Undefined m) Source # 
Instance details

Defined in Data.Morpheus.Types.Types

type Rep (Undefined m) = D1 (MetaData "Undefined" "Data.Morpheus.Types.Types" "morpheus-graphql-0.8.0-GqQbC5VkuucF3CVtmsv1IY" False) (C1 (MetaCons "Undefined" PrefixI False) (U1 :: Type -> Type))
type KIND (Undefined m) Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

type IORes e = Res e IO Source #

data Resolver (o :: OperationType) event (m :: * -> *) value where Source #

Constructors

QueryResolver 

Fields

MutResolver 

Fields

SubResolver 

Fields

Instances
MonadTrans (Resolver MUTATION e) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.Resolving.Resolver

Methods

lift :: Monad m => m a -> Resolver MUTATION e m a #

MonadTrans (Resolver QUERY e) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.Resolving.Resolver

Methods

lift :: Monad m => m a -> Resolver QUERY e m a #

Monad m => Monad (Resolver MUTATION e m) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.Resolving.Resolver

Methods

(>>=) :: Resolver MUTATION e m a -> (a -> Resolver MUTATION e m b) -> Resolver MUTATION e m b #

(>>) :: Resolver MUTATION e m a -> Resolver MUTATION e m b -> Resolver MUTATION e m b #

return :: a -> Resolver MUTATION e m a #

fail :: String -> Resolver MUTATION e m a #

Monad m => Monad (Resolver QUERY e m) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.Resolving.Resolver

Methods

(>>=) :: Resolver QUERY e m a -> (a -> Resolver QUERY e m b) -> Resolver QUERY e m b #

(>>) :: Resolver QUERY e m a -> Resolver QUERY e m b -> Resolver QUERY e m b #

return :: a -> Resolver QUERY e m a #

fail :: String -> Resolver QUERY e m a #

Functor m => Functor (Resolver o e m) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.Resolving.Resolver

Methods

fmap :: (a -> b) -> Resolver o e m a -> Resolver o e m b #

(<$) :: a -> Resolver o e m b -> Resolver o e m a #

(LiftEither o Resolver, Monad m) => Applicative (Resolver o e m) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.Resolving.Resolver

Methods

pure :: a -> Resolver o e m a #

(<*>) :: Resolver o e m (a -> b) -> Resolver o e m a -> Resolver o e m b #

liftA2 :: (a -> b -> c) -> Resolver o e m a -> Resolver o e m b -> Resolver o e m c #

(*>) :: Resolver o e m a -> Resolver o e m b -> Resolver o e m b #

(<*) :: Resolver o e m a -> Resolver o e m b -> Resolver o e m a #

GQLType a => GQLType (Resolver o e m a) Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND (Resolver o e m a) :: GQL_KIND Source #

type CUSTOM (Resolver o e m a) :: Bool

type KIND (Resolver o e m a) Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

type KIND (Resolver o e m a) = WRAPPER

liftEither :: (LiftEither o res, Monad m) => m (Either (ResError res) a) -> res o event m a Source #

lift :: (MonadTrans t, Monad m) => m a -> t m a #

Lift a computation from the argument monad to the constructed monad.

type ResolveQ e m a = Res e m (a (Res e m)) Source #

type ResolveM e m a = MutRes e m (a (MutRes e m)) Source #

type ResolveS e m a = SubRes e m (a (Res e m)) Source #

failRes :: (LiftEither o Resolver, Monad m) => String -> Resolver o e m a Source #