Module Websocket_handler.Make

Parameters

module Ws : Graphql_websocket.Connection.S with type 'a IO.t = 'a IO.t

Signature

module Json = Yojson.Basic.Util
val (>>=) : 'a IO.t -> ( 'a -> 'b IO.t ) -> 'b IO.t
type t = {
conn : Ws.t;
subscriptions : ( string, unit -> unit ) Stdlib.Hashtbl.t;
}
type client_message =
| Gql_connection_init
| Gql_start of {
id : string;
query : string;
variables : (string * Graphql_parser.const_value) list option;
operation_name : string option;
}
| Gql_stop of {
id : string;
}
| Gql_connection_terminate
type server_message =
| Gql_connection_error
| Gql_connection_ack
| Gql_data
| Gql_error
| Gql_complete
val client_message_of_payload : Yojson.Basic.t -> ( client_message, string ) Stdlib.result
val server_message_to_string : server_message -> string
val create_message : ?opcode:Graphql_websocket.Frame.Opcode.t -> ?id:string -> ?payload:Yojson.Basic.t -> server_message -> Graphql_websocket.Frame.t
val handle_frame : t -> execute_query: ( (string * Graphql_parser.const_value) list option -> string option -> string -> ( [< `Response of Yojson.Basic.t | `Stream of ( Yojson.Basic.t, Yojson.Basic.t ) Stdlib.result IO.Stream.t ], Yojson.Basic.t ) Stdlib.result IO.t ) -> Graphql_websocket.Frame.t -> unit Ws.IO.t
val handle : ( (string * Graphql_parser.const_value) list option -> string option -> string -> ( [< `Response of Yojson.Basic.t | `Stream of ( Yojson.Basic.t, Yojson.Basic.t ) Stdlib.result IO.Stream.t ], Yojson.Basic.t ) Stdlib.result IO.t ) -> Ws.t -> 'a IO.t