morpheus-graphql-0.6.0: Morpheus GraphQL

Safe HaskellNone
LanguageHaskell2010

Data.Morpheus.Types

Description

GQL Types

Synopsis

Documentation

data Event e c Source #

Constructors

Event 

Fields

class GQLType a where Source #

GraphQL type, every graphQL type should have an instance of Generic and GQLType.

   ... deriving (Generic, GQLType)
 

if you want to add description

      ... deriving (Generic)

    instance GQLType ... where
      description = const "your description ..."
 

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

Methods

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

__typeName :: Proxy () -> Text

__typeFingerprint :: Proxy () -> DataFingerprint

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

Methods

description :: Proxy [a] -> Maybe Text Source #

__typeName :: Proxy [a] -> Text

__typeFingerprint :: Proxy [a] -> DataFingerprint

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

Methods

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

__typeName :: Proxy (Maybe a) -> Text

__typeFingerprint :: Proxy (Maybe a) -> DataFingerprint

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

Methods

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

__typeName :: Proxy (Set a) -> Text

__typeFingerprint :: Proxy (Set a) -> DataFingerprint

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 #

__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

Methods

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

__typeName :: Proxy (Either s a) -> Text

__typeFingerprint :: Proxy (Either s a) -> DataFingerprint

(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

Methods

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

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

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

(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

Methods

description :: Proxy (Map k v) -> Maybe Text Source #

__typeName :: Proxy (Map k v) -> Text

__typeFingerprint :: Proxy (Map k v) -> DataFingerprint

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

Defined in Data.Morpheus.Types.GQLType

Associated Types

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

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

Methods

description :: Proxy (Resolver o m e a) -> Maybe Text Source #

__typeName :: Proxy (Resolver o m e a) -> Text

__typeFingerprint :: Proxy (Resolver o m e a) -> DataFingerprint

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 

Fields

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

data GQLResponse Source #

GraphQL Response

Constructors

Data Value 
Errors [JSONError] 
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.6.0-6qvV6nfWXVL2ixtR5y4PV5" 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.Value

Generic ScalarValue Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.Value

Associated Types

type Rep ScalarValue :: Type -> Type #

Lift ScalarValue Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.Value

Methods

lift :: ScalarValue -> Q Exp #

ToJSON ScalarValue Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.Value

FromJSON ScalarValue Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.Value

type Rep ScalarValue Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.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 :: (PureOperation o, Monad m) => b -> a -> Resolver o m e b Source #

constMutRes :: Monad m => [e] -> a -> args -> MutRes m e 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.6.0-6qvV6nfWXVL2ixtR5y4PV5" False) (C1 (MetaCons "Undefined" PrefixI False) (U1 :: Type -> Type))
type KIND (Undefined m) Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

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

Constructors

FailedResolver 

Fields

QueryResolver 

Fields

MutResolver 

Fields

SubResolver 

Fields

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

Defined in Data.Morpheus.Types.Internal.Resolver

Methods

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

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

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

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

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

Defined in Data.Morpheus.Types.Internal.Resolver

Methods

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

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

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

Defined in Data.Morpheus.Types.Internal.Resolver

Methods

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

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

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

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

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

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

Defined in Data.Morpheus.Types.GQLType

Associated Types

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

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

Methods

description :: Proxy (Resolver o m e a) -> Maybe Text Source #

__typeName :: Proxy (Resolver o m e a) -> Text

__typeFingerprint :: Proxy (Resolver o m e a) -> DataFingerprint

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

Defined in Data.Morpheus.Types.GQLType

type KIND (Resolver o m e a) = WRAPPER

type QUERY = Query Source #

type MUTATION = Mutation Source #

type SUBSCRIPTION = Subscription Source #

liftEitherM :: (PureOperation o, Monad m) => m (Either String a) -> Resolver o m e a Source #

liftM :: (PureOperation o, Monad m) => m a -> Resolver o m e a Source #