Safe Haskell | None |
---|---|
Language | Haskell2010 |
This file contains types for both the websocket protocols (Apollo) and (graphql-ws) | See Apollo: https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md | See graphql-ws: https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md
Synopsis
- data WSSubProtocol
- showSubProtocol :: WSSubProtocol -> String
- toWSSubProtocol :: String -> WSSubProtocol
- newtype OperationId = OperationId {
- unOperationId :: Text
- unsafeMkOperationId :: Text -> OperationId
- data ServerMsgType
- data ConnParams = ConnParams {
- _cpHeaders :: Maybe (HashMap Text Text)
- data StartMsg = StartMsg {
- _smId :: !OperationId
- _smPayload :: !GQLReqUnparsed
- data StopMsg = StopMsg {
- _stId :: OperationId
- data PingPongPayload = PingPongPayload {
- _smMessage :: !(Maybe Text)
- keepAliveMessage :: PingPongPayload
- data SubscribeMsg = SubscribeMsg {}
- data ClientMsg
- = CMConnInit !(Maybe ConnParams)
- | CMStart !StartMsg
- | CMStop !StopMsg
- | CMConnTerm
- | CMPing !(Maybe PingPongPayload)
- | CMPong !(Maybe PingPongPayload)
- data DataMsg = DataMsg {
- _dmId :: !OperationId
- _dmPayload :: !GQResponse
- data ErrorMsg = ErrorMsg {
- _emId :: !OperationId
- _emPayload :: !Value
- newtype CompletionMsg = CompletionMsg {}
- newtype ConnErrMsg = ConnErrMsg {
- unConnErrMsg :: Text
- data ServerErrorMsg = ServerErrorMsg {
- unServerErrorMsg :: Text
- data ServerMsg
- data ServerErrorCode
- encodeServerErrorMsg :: ServerErrorCode -> ByteString
- encodeServerMsg :: ServerMsg -> ByteString
- data WSConnInitTimerStatus
- type WSConnInitTimer = (TVar WSConnInitTimerStatus, TMVar ())
- getWSTimerState :: WSConnInitTimer -> IO WSConnInitTimerStatus
- getNewWSTimer :: Seconds -> IO WSConnInitTimer
Documentation
data WSSubProtocol Source #
Instances
Eq WSSubProtocol Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol (==) :: WSSubProtocol -> WSSubProtocol -> Bool # (/=) :: WSSubProtocol -> WSSubProtocol -> Bool # | |
Show WSSubProtocol Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol showsPrec :: Int -> WSSubProtocol -> ShowS # show :: WSSubProtocol -> String # showList :: [WSSubProtocol] -> ShowS # |
newtype OperationId Source #
OperationId | |
|
Instances
unsafeMkOperationId :: Text -> OperationId Source #
data ServerMsgType Source #
SMT_GQL_CONNECTION_KEEP_ALIVE | |
SMT_GQL_CONNECTION_ERROR | |
SMT_GQL_DATA | |
SMT_GQL_NEXT | |
SMT_GQL_PING | |
SMT_GQL_PONG | |
SMT_GQL_CONNECTION_ACK | |
SMT_GQL_ERROR | |
SMT_GQL_COMPLETE |
Instances
Eq ServerMsgType Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol (==) :: ServerMsgType -> ServerMsgType -> Bool # (/=) :: ServerMsgType -> ServerMsgType -> Bool # | |
Show ServerMsgType Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol showsPrec :: Int -> ServerMsgType -> ShowS # show :: ServerMsgType -> String # showList :: [ServerMsgType] -> ShowS # | |
ToJSON ServerMsgType Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol toJSON :: ServerMsgType -> Value toEncoding :: ServerMsgType -> Encoding toJSONList :: [ServerMsgType] -> Value toEncodingList :: [ServerMsgType] -> Encoding |
data ConnParams Source #
ConnParams | |
|
Instances
Eq ConnParams Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol (==) :: ConnParams -> ConnParams -> Bool # (/=) :: ConnParams -> ConnParams -> Bool # | |
Show ConnParams Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol showsPrec :: Int -> ConnParams -> ShowS # show :: ConnParams -> String # showList :: [ConnParams] -> ShowS # | |
FromJSON ConnParams Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol parseJSON :: Value -> Parser ConnParams parseJSONList :: Value -> Parser [ConnParams] | |
ToJSON ConnParams Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol toJSON :: ConnParams -> Value toEncoding :: ConnParams -> Encoding toJSONList :: [ConnParams] -> Value toEncodingList :: [ConnParams] -> Encoding |
StartMsg | |
|
Instances
Eq StartMsg Source # | |
Show StartMsg Source # | |
FromJSON StartMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol parseJSON :: Value -> Parser StartMsg parseJSONList :: Value -> Parser [StartMsg] | |
ToJSON StartMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol toEncoding :: StartMsg -> Encoding toJSONList :: [StartMsg] -> Value toEncodingList :: [StartMsg] -> Encoding |
Instances
Eq StopMsg Source # | |
Show StopMsg Source # | |
FromJSON StopMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol parseJSON :: Value -> Parser StopMsg parseJSONList :: Value -> Parser [StopMsg] | |
ToJSON StopMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol toEncoding :: StopMsg -> Encoding toJSONList :: [StopMsg] -> Value toEncodingList :: [StopMsg] -> Encoding |
data PingPongPayload Source #
PingPongPayload | |
|
Instances
Eq PingPongPayload Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol (==) :: PingPongPayload -> PingPongPayload -> Bool # (/=) :: PingPongPayload -> PingPongPayload -> Bool # | |
Show PingPongPayload Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol showsPrec :: Int -> PingPongPayload -> ShowS # show :: PingPongPayload -> String # showList :: [PingPongPayload] -> ShowS # | |
FromJSON PingPongPayload Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol parseJSON :: Value -> Parser PingPongPayload parseJSONList :: Value -> Parser [PingPongPayload] | |
ToJSON PingPongPayload Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol toJSON :: PingPongPayload -> Value toEncoding :: PingPongPayload -> Encoding toJSONList :: [PingPongPayload] -> Value toEncodingList :: [PingPongPayload] -> Encoding |
data SubscribeMsg Source #
CMConnInit !(Maybe ConnParams) | |
CMStart !StartMsg | |
CMStop !StopMsg | |
CMConnTerm | |
CMPing !(Maybe PingPongPayload) | |
CMPong !(Maybe PingPongPayload) |
DataMsg | |
|
ErrorMsg | |
|
newtype CompletionMsg Source #
Instances
Eq CompletionMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol (==) :: CompletionMsg -> CompletionMsg -> Bool # (/=) :: CompletionMsg -> CompletionMsg -> Bool # | |
Show CompletionMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol showsPrec :: Int -> CompletionMsg -> ShowS # show :: CompletionMsg -> String # showList :: [CompletionMsg] -> ShowS # | |
FromJSON CompletionMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol parseJSON :: Value -> Parser CompletionMsg parseJSONList :: Value -> Parser [CompletionMsg] | |
ToJSON CompletionMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol toJSON :: CompletionMsg -> Value toEncoding :: CompletionMsg -> Encoding toJSONList :: [CompletionMsg] -> Value toEncodingList :: [CompletionMsg] -> Encoding |
newtype ConnErrMsg Source #
ConnErrMsg | |
|
Instances
Eq ConnErrMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol (==) :: ConnErrMsg -> ConnErrMsg -> Bool # (/=) :: ConnErrMsg -> ConnErrMsg -> Bool # | |
Show ConnErrMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol showsPrec :: Int -> ConnErrMsg -> ShowS # show :: ConnErrMsg -> String # showList :: [ConnErrMsg] -> ShowS # | |
IsString ConnErrMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol fromString :: String -> ConnErrMsg # | |
FromJSON ConnErrMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol parseJSON :: Value -> Parser ConnErrMsg parseJSONList :: Value -> Parser [ConnErrMsg] | |
ToJSON ConnErrMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol toJSON :: ConnErrMsg -> Value toEncoding :: ConnErrMsg -> Encoding toJSONList :: [ConnErrMsg] -> Value toEncodingList :: [ConnErrMsg] -> Encoding |
data ServerErrorMsg Source #
ServerErrorMsg | |
|
data ServerErrorCode Source #
This is sent from the server to the client while closing the websocket on encountering an error.
ProtocolError1002 | |
GenericError4400 !String | |
Unauthorized4401 | |
Forbidden4403 | |
ConnectionInitTimeout4408 | |
NonUniqueSubscription4409 !OperationId | |
TooManyRequests4429 |
Instances
Show ServerErrorCode Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol showsPrec :: Int -> ServerErrorCode -> ShowS # show :: ServerErrorCode -> String # showList :: [ServerErrorCode] -> ShowS # |
data WSConnInitTimerStatus Source #
Instances
Eq WSConnInitTimerStatus Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol (==) :: WSConnInitTimerStatus -> WSConnInitTimerStatus -> Bool # (/=) :: WSConnInitTimerStatus -> WSConnInitTimerStatus -> Bool # | |
Show WSConnInitTimerStatus Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol showsPrec :: Int -> WSConnInitTimerStatus -> ShowS # show :: WSConnInitTimerStatus -> String # showList :: [WSConnInitTimerStatus] -> ShowS # |
type WSConnInitTimer = (TVar WSConnInitTimerStatus, TMVar ()) Source #
getNewWSTimer :: Seconds -> IO WSConnInitTimer Source #