Safe Haskell | Safe-Inferred |
---|---|
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
- data OperationId
- unsafeMkOperationId :: Text -> OperationId
- data ServerMsgType
- data ConnParams
- data StartMsg = StartMsg !OperationId !GQLReqUnparsed
- data StopMsg = StopMsg OperationId
- data PingPongPayload
- keepAliveMessage :: PingPongPayload
- data ClientMsg
- = CMConnInit !(Maybe ConnParams)
- | CMStart !StartMsg
- | CMStop !StopMsg
- | CMConnTerm
- | CMPing !(Maybe PingPongPayload)
- | CMPong !(Maybe PingPongPayload)
- data DataMsg = DataMsg !OperationId !GQResponse
- data ErrorMsg = ErrorMsg !OperationId !Encoding
- newtype CompletionMsg = CompletionMsg OperationId
- newtype ConnErrMsg = ConnErrMsg {
- unConnErrMsg :: Text
- data ServerMsg
- data ServerErrorCode
- encodeServerErrorMsg :: ServerErrorCode -> ByteString
- encodeServerMsg :: ServerMsg -> ByteString
- data WSConnInitTimerStatus = Done
- getWSTimerState :: WSConnInitTimer -> IO WSConnInitTimerStatus
- getNewWSTimer :: Seconds -> IO WSConnInitTimer
Documentation
data WSSubProtocol Source #
Instances
Show WSSubProtocol Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol showsPrec :: Int -> WSSubProtocol -> ShowS # show :: WSSubProtocol -> String # showList :: [WSSubProtocol] -> ShowS # | |
Eq WSSubProtocol Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol (==) :: WSSubProtocol -> WSSubProtocol -> Bool # (/=) :: WSSubProtocol -> WSSubProtocol -> Bool # |
data OperationId Source #
Instances
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
ToJSON ServerMsgType Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol toJSON :: ServerMsgType -> Value Source # toEncoding :: ServerMsgType -> Encoding Source # toJSONList :: [ServerMsgType] -> Value Source # toEncodingList :: [ServerMsgType] -> Encoding Source # | |
Show ServerMsgType Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol showsPrec :: Int -> ServerMsgType -> ShowS # show :: ServerMsgType -> String # showList :: [ServerMsgType] -> ShowS # | |
Eq ServerMsgType Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol (==) :: ServerMsgType -> ServerMsgType -> Bool # (/=) :: ServerMsgType -> ServerMsgType -> Bool # |
data ConnParams Source #
Instances
Instances
FromJSON StartMsg Source # | |
ToJSON StartMsg Source # | |
Generic StartMsg Source # | |
Show StartMsg Source # | |
Eq StartMsg Source # | |
type Rep StartMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol type Rep StartMsg = D1 ('MetaData "StartMsg" "Hasura.GraphQL.Transport.WebSocket.Protocol" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "StartMsg" 'PrefixI 'True) (S1 ('MetaSel ('Just "_smId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 OperationId) :*: S1 ('MetaSel ('Just "_smPayload") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GQLReqUnparsed))) |
Instances
FromJSON StopMsg Source # | |
ToJSON StopMsg Source # | |
Generic StopMsg Source # | |
Show StopMsg Source # | |
Eq StopMsg Source # | |
type Rep StopMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol type Rep StopMsg = D1 ('MetaData "StopMsg" "Hasura.GraphQL.Transport.WebSocket.Protocol" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "StopMsg" 'PrefixI 'True) (S1 ('MetaSel ('Just "_stId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 OperationId))) |
data PingPongPayload Source #
Instances
CMConnInit !(Maybe ConnParams) | |
CMStart !StartMsg | |
CMStop !StopMsg | |
CMConnTerm | |
CMPing !(Maybe PingPongPayload) | |
CMPong !(Maybe PingPongPayload) |
newtype CompletionMsg Source #
Instances
FromJSON CompletionMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol parseJSON :: Value -> Parser CompletionMsg Source # parseJSONList :: Value -> Parser [CompletionMsg] Source # | |
ToJSON CompletionMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol toJSON :: CompletionMsg -> Value Source # toEncoding :: CompletionMsg -> Encoding Source # toJSONList :: [CompletionMsg] -> Value Source # toEncodingList :: [CompletionMsg] -> Encoding Source # | |
Show CompletionMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol showsPrec :: Int -> CompletionMsg -> ShowS # show :: CompletionMsg -> String # showList :: [CompletionMsg] -> ShowS # | |
Eq CompletionMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol (==) :: CompletionMsg -> CompletionMsg -> Bool # (/=) :: CompletionMsg -> CompletionMsg -> Bool # |
newtype ConnErrMsg Source #
Instances
FromJSON ConnErrMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol parseJSON :: Value -> Parser ConnErrMsg Source # parseJSONList :: Value -> Parser [ConnErrMsg] Source # | |
ToJSON ConnErrMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol toJSON :: ConnErrMsg -> Value Source # toEncoding :: ConnErrMsg -> Encoding Source # toJSONList :: [ConnErrMsg] -> Value Source # toEncodingList :: [ConnErrMsg] -> Encoding Source # | |
IsString ConnErrMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol fromString :: String -> ConnErrMsg # | |
Show ConnErrMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol showsPrec :: Int -> ConnErrMsg -> ShowS # show :: ConnErrMsg -> String # showList :: [ConnErrMsg] -> ShowS # | |
Eq ConnErrMsg Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol (==) :: ConnErrMsg -> ConnErrMsg -> Bool # (/=) :: ConnErrMsg -> ConnErrMsg -> Bool # |
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
Show WSConnInitTimerStatus Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol showsPrec :: Int -> WSConnInitTimerStatus -> ShowS # show :: WSConnInitTimerStatus -> String # showList :: [WSConnInitTimerStatus] -> ShowS # | |
Eq WSConnInitTimerStatus Source # | |
Defined in Hasura.GraphQL.Transport.WebSocket.Protocol (==) :: WSConnInitTimerStatus -> WSConnInitTimerStatus -> Bool # (/=) :: WSConnInitTimerStatus -> WSConnInitTimerStatus -> Bool # |
getWSTimerState :: WSConnInitTimer -> IO WSConnInitTimerStatus Source #
getNewWSTimer :: Seconds -> IO WSConnInitTimer Source #