morpheus-graphql-0.3.1: Morpheus GraphQL

Safe HaskellNone
LanguageHaskell2010

Data.Morpheus.Types

Description

GQL Types

Synopsis

Documentation

resolver :: m (Either String a) -> Resolver m a Source #

GraphQL Resolver

mutResolver :: Monad m => [Event e c] -> StreamT m (Event e c) (Either String a) -> MutResolver m e c a Source #

GraphQL Resolver for mutation or subscription resolver , adds effect to normal resolver

toMutResolver :: Monad m => [Event e c] -> Resolver m a -> MutResolver m e c a Source #

type IOMutRes e c = MutResolver IO e c Source #

type IOSubRes e c = SubResolver IO e c Source #

type SubRootRes m e sub = Resolver (SubscribeStream m e) sub Source #

data SubResolver m e c a Source #

Constructors

SubResolver 

Fields

Instances
GQLType a => GQLType (SubResolver m e c a) Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND (SubResolver m e c a) :: GQL_KIND Source #

type CUSTOM (SubResolver m e c a) :: Bool

Methods

description :: Proxy (SubResolver m e c a) -> Maybe Text Source #

__typeVisibility :: Proxy (SubResolver m e c a) -> Bool

__typeName :: Proxy (SubResolver m e c a) -> Text

__typeFingerprint :: Proxy (SubResolver m e c a) -> DataFingerprint

type KIND (SubResolver m e c a) Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

type KIND (SubResolver m e c a) = WRAPPER

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 #

__typeVisibility :: Proxy () -> Bool

__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 #

__typeVisibility :: Proxy [a] -> Bool

__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

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 #

__typeVisibility :: Proxy (Set a) -> Bool

__typeName :: Proxy (Set a) -> Text

__typeFingerprint :: Proxy (Set a) -> DataFingerprint

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 #

__typeVisibility :: 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

Methods

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

__typeVisibility :: Proxy (Either s a) -> Bool

__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 #

__typeVisibility :: Proxy (a, b) -> Bool

__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 #

__typeVisibility :: Proxy (Map k v) -> Bool

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

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

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

Defined in Data.Morpheus.Types.GQLType

Associated Types

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

type CUSTOM (Resolver m a) :: Bool

GQLType a => GQLType (SubResolver m e c a) Source # 
Instance details

Defined in Data.Morpheus.Types.GQLType

Associated Types

type KIND (SubResolver m e c a) :: GQL_KIND Source #

type CUSTOM (SubResolver m e c a) :: Bool

Methods

description :: Proxy (SubResolver m e c a) -> Maybe Text Source #

__typeVisibility :: Proxy (SubResolver m e c a) -> Bool

__typeName :: Proxy (SubResolver m e c a) -> Text

__typeFingerprint :: Proxy (SubResolver m e c 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 c Source # 
Instance details

Defined in Data.Morpheus.Execution.Server.Interpreter

Methods

interpreter :: (Monad m, RootResCon m e c que mut sub) => GQLRootResolver m e c que 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 c Source # 
Instance details

Defined in Data.Morpheus.Execution.Server.Interpreter

Methods

interpreter :: (Monad m, RootResCon m e c que mut sub) => GQLRootResolver m e c que 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.3.1-8TZJOnuB0KG2eH3KKlQ3RW" 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 e c 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 :: Monad m => b -> a -> m b Source #