From 6365762ae848dc4022b04884cb0c201bbcc7368d Mon Sep 17 00:00:00 2001 From: Timo Netzer Date: Sat, 28 Dec 2024 23:13:21 +0100 Subject: [PATCH] fix i-graphql example --- example/i-graphql/graphql.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/example/i-graphql/graphql.ml b/example/i-graphql/graphql.ml index 45d52d82..823d69a8 100644 --- a/example/i-graphql/graphql.ml +++ b/example/i-graphql/graphql.ml @@ -5,7 +5,7 @@ let hardcoded_users = [ {id = 2; name = "bob"}; ] -let user = +let user () = Graphql_lwt.Schema.(obj "user" ~fields:[ field "id" @@ -18,10 +18,10 @@ let user = ~resolve:(fun _info user -> user.name); ]) -let schema = +let schema () = Graphql_lwt.Schema.(schema [ field "users" - ~typ:(non_null (list (non_null user))) + ~typ:(non_null (list (non_null (user ())))) ~args:Arg.[arg "id" ~typ:int] ~resolve:(fun _info () id -> match id with @@ -40,6 +40,6 @@ let () = @@ Dream.logger @@ Dream.origin_referrer_check @@ Dream.router [ - Dream.any "/graphql" (Dream.graphql Lwt.return schema); + Dream.any "/graphql" (Dream.graphql Lwt.return (schema ())); Dream.get "/" (Dream.graphiql ~default_query "/graphql"); ]