From eee2841dd1141de7150247e044ff277e9a53dc9e Mon Sep 17 00:00:00 2001 From: Guillaume Petiot Date: Mon, 26 Feb 2024 13:13:49 +0000 Subject: [PATCH] Add .mli for graphql --- lib/contributions.ml | 2 +- lib/graphql.ml | 2 +- lib/graphql.mli | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 lib/graphql.mli diff --git a/lib/contributions.ml b/lib/contributions.ml index c05df53..5b7a9c6 100644 --- a/lib/contributions.ml +++ b/lib/contributions.ml @@ -61,7 +61,7 @@ let fetch ~period:(start, finish) ~token = "from", `String start; "to", `String finish; ] in - Graphql.exec token ~variables query + Graphql.exec ~token ~variables ~query () end module Datetime = struct diff --git a/lib/graphql.ml b/lib/graphql.ml index 0c8238d..36e4dec 100644 --- a/lib/graphql.ml +++ b/lib/graphql.ml @@ -4,7 +4,7 @@ let graphql_endpoint = Uri.of_string "https://api.github.com/graphql" let ( / ) a b = Yojson.Safe.Util.member b a -let exec ?variables token query = +let exec ?variables ~token ~query () = let body = `Assoc ( ("query", `String query) :: diff --git a/lib/graphql.mli b/lib/graphql.mli new file mode 100644 index 0000000..325aae8 --- /dev/null +++ b/lib/graphql.mli @@ -0,0 +1 @@ +val exec : ?variables:(string * Yojson.Safe.t) list -> token:string -> query:string -> unit -> Yojson.Safe.t Lwt.t