diff --git a/graphql-async/test/async_test.ml b/graphql-async/test/async_test.ml index fc10679..dd2a873 100644 --- a/graphql-async/test/async_test.ml +++ b/graphql-async/test/async_test.ml @@ -23,7 +23,7 @@ let test_query schema ctx query expected = | Ok (`Stream stream) -> Async_kernel.Pipe.to_list stream >>| fun lst -> `List - Core_kernel.( + Core.( List.map lst ~f:(fun x -> Option.value_exn (Result.ok x))) | Error err -> Async_kernel.return err) >>| fun result -> diff --git a/graphql-cohttp/src/graphql_cohttp.ml b/graphql-cohttp/src/graphql_cohttp.ml index ce43f61..a4d18ab 100644 --- a/graphql-cohttp/src/graphql_cohttp.ml +++ b/graphql-cohttp/src/graphql_cohttp.ml @@ -113,7 +113,7 @@ module Make (Io : Cohttp.S.IO with type 'a t = 'a Schema.Io.t) (Body : HttpBody with type +'a io := 'a Schema.Io.t) = struct - module Ws = Websocket.Connection.Make (Io) + module Ws = Graphql_websocket.Connection.Make (Io) module Websocket_transport = Websocket_handler.Make (Schema.Io) (Ws) let ( >>= ) = Io.( >>= ) diff --git a/graphql-cohttp/src/websocket.ml b/graphql-cohttp/src/graphql_websocket.ml similarity index 100% rename from graphql-cohttp/src/websocket.ml rename to graphql-cohttp/src/graphql_websocket.ml diff --git a/graphql-cohttp/src/websocket.mli b/graphql-cohttp/src/graphql_websocket.mli similarity index 100% rename from graphql-cohttp/src/websocket.mli rename to graphql-cohttp/src/graphql_websocket.mli diff --git a/graphql-cohttp/src/websocket_handler.ml b/graphql-cohttp/src/websocket_handler.ml index 15c57cb..43216c8 100644 --- a/graphql-cohttp/src/websocket_handler.ml +++ b/graphql-cohttp/src/websocket_handler.ml @@ -1,6 +1,6 @@ module Make (IO : Graphql_intf.IO) - (Ws : Websocket.Connection.S with type 'a IO.t = 'a IO.t) = + (Ws : Graphql_websocket.Connection.S with type 'a IO.t = 'a IO.t) = struct module Json = Yojson.Basic.Util @@ -61,7 +61,7 @@ struct (* | Gql_connection_keep_alive -> "ka" *) - let create_message ?(opcode = Websocket.Frame.Opcode.Text) ?id + let create_message ?(opcode = Graphql_websocket.Frame.Opcode.Text) ?id ?(payload = `Null) typ = let frame_payload = `Assoc @@ -72,13 +72,13 @@ struct ] in let content = Yojson.Basic.to_string frame_payload in - Websocket.Frame.create ~opcode ~content () + Graphql_websocket.Frame.create ~opcode ~content () let handle_frame t ~execute_query frame = - match frame.Websocket.Frame.opcode with + match frame.Graphql_websocket.Frame.opcode with | Ping | Pong | Close | Ctrl _ | Nonctrl _ -> IO.return () | Continuation | Text | Binary -> ( - let json = Yojson.Basic.from_string frame.Websocket.Frame.content in + let json = Yojson.Basic.from_string frame.Graphql_websocket.Frame.content in match client_message_of_payload json with | Ok Gql_connection_init -> Ws.send t.conn (create_message Gql_connection_ack) @@ -106,7 +106,7 @@ struct | Ok Gql_connection_terminate -> Hashtbl.iter (fun _id close -> close ()) t.subscriptions; Ws.send t.conn - (create_message ~opcode:Websocket.Frame.Opcode.Close + (create_message ~opcode:Graphql_websocket.Frame.Opcode.Close Gql_connection_error) | Error msg -> let id = Json.(json |> member "id" |> to_string) in diff --git a/graphql_parser/src/ast.ml b/graphql_parser/src/ast.ml index b17ee0b..ae41a9c 100644 --- a/graphql_parser/src/ast.ml +++ b/graphql_parser/src/ast.ml @@ -138,7 +138,7 @@ module Pp = struct and selection_set fmt = omit_empty_list - Fmt.(braces (hvbox ~indent:2 (prefix cut (list pp_selection)))) + Fmt.(braces (hvbox ~indent:2 (cut ++ (list pp_selection)))) fmt let rec pp_typ fmt = function