morpheus-graphql-0.13.0: Morpheus GraphQL

Safe HaskellNone
LanguageHaskell2010

Data.Morpheus.Types.Internal.Subscription

Synopsis

Documentation

disconnect :: Scope WS e m -> Input WS -> m () Source #

connectionThread :: MonadUnliftIO m => (Input WS -> Stream WS e m) -> Scope WS e m -> m () Source #

runStreamWS :: Monad m => Scope WS e m -> Stream WS e m -> m () Source #

data Stream (api :: API) e (m :: * -> *) Source #

Instances
Interpreter e m (Input api) (Stream api e m) Source # 
Instance details

Defined in Data.Morpheus.Server.Deriving.Interpreter

Methods

interpreter :: (Monad m, RootResCon m e query mut sub) => RootResolver m e query mut sub -> Input api -> Stream api e m Source #

data Scope (api :: API) event (m :: * -> *) where Source #

Constructors

ScopeHTTP 

Fields

ScopeWS 

Fields

data Input (api :: API) where Source #

Constructors

Init :: ID -> Input WS 
Request :: GQLRequest -> Input HTTP 
Instances
Interpreter e m (Input api) (Stream api e m) Source # 
Instance details

Defined in Data.Morpheus.Server.Deriving.Interpreter

Methods

interpreter :: (Monad m, RootResCon m e query mut sub) => RootResolver m e query mut sub -> Input api -> Stream api e m Source #

type WS = WS Source #

type HTTP = HTTP Source #

publish :: (Eq (StreamChannel event), GQLChannel event, Monad m) => event -> ClientConnectionStore event m -> m () Source #

data Store e m Source #

PubSubStore interface shared GraphQL state between websocket and http server, you can define your own store if you provide write and read methods to work properly Morpheus needs all entries of ClientConnectionStore (+ client Callbacks) that why it is recomended that you use many local ClientStores on evenry server node rathen then single centralized Store.

Constructors

Store 

initDefaultStore :: (MonadIO m, MonadIO m2, Eq (StreamChannel event), GQLChannel event) => m2 (Store event m) Source #

initializes empty GraphQL state

publishEventWith :: (MonadIO m, Eq (StreamChannel event), GQLChannel event) => Store event m -> event -> m () Source #

class GQLChannel a where #

Associated Types

type StreamChannel a :: Type #

Methods

streamChannels :: a -> [Channel a] #

Instances
GQLChannel () 
Instance details

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

Associated Types

type StreamChannel () :: Type #

Methods

streamChannels :: () -> [Channel ()] #

GQLChannel (Event channel content) 
Instance details

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

Associated Types

type StreamChannel (Event channel content) :: Type #

Methods

streamChannels :: Event channel content -> [Channel (Event channel content)] #

empty :: Collection a coll => coll #

toList :: ClientConnectionStore e m -> [(UUID, ClientConnection e m)] Source #

connectionSessionIds :: ClientConnection e m -> [SessionID] Source #