anmonteiro / reason-graphql-fullstack

Fullstack Reason + GraphQL Todo List App
MIT License
245 stars 19 forks source link

an expression was expected of type Shared.Types.todo list GQL.Schema.io = Shared.Types.todo list Lwt.t #2

Closed dvisztempacct closed 6 years ago

dvisztempacct commented 6 years ago

Using opam 2.0.0~rc2 and ocamlc 4.06.1 trying to build reason-graphql-fullstack 85dd67be8f3f4ea663f0834e5ff280a24cea618b I had to manually install an extra package cohttp-lwt-unix 1.0.2 to get it to run ocamlc

donviszneki@Dons-MacBook-Pro ~/foobar$ jbuilder build @graphql && jbuilder exec graphql
File "/Users/donviszneki/.opam/default/lib/cohttp/META", line 1, characters 0-0:
Error: Library "cohttp-lwt-unix" not found.
-> required by library "cohttp.lwt" in /Users/donviszneki/.opam/default/lib/cohttp

Once that was solved, ocamlc gave me the following error:

donviszneki@Dons-MacBook-Pro ~/foobar$ jbuilder build @graphql && jbuilder exec graphql
      ocamlc src/server/.main.eobjs/schema.{cmi,cmo,cmt} (exit 2)
(cd _build/default && /usr/local/bin/ocamlc.opt -w -40 -g -bin-annot -I src/server/.main.eobjs -I /Users/donviszneki/.opam/default/lib/angstrom -I /Users/donviszneki/.opam/default/lib/astring -I /Users/donviszneki/.opam/default/lib/base -I /Users/donviszneki/.opam/default/lib/base/caml -I /Users/donviszneki/.opam/default/lib/base/shadow_stdlib -I /Users/donviszneki/.opam/default/lib/base64 -I /Users/donviszneki/.opam/default/lib/biniou -I /Users/donviszneki/.opam/default/lib/bytes -I /Users/donviszneki/.opam/default/lib/cohttp -I /Users/donviszneki/.opam/default/lib/cohttp-lwt -I /Users/donviszneki/.opam/default/lib/cohttp-lwt-unix -I /Users/donviszneki/.opam/default/lib/conduit -I /Users/donviszneki/.opam/default/lib/conduit-lwt -I /Users/donviszneki/.opam/default/lib/conduit-lwt-unix -I /Users/donviszneki/.opam/default/lib/easy-format -I /Users/donviszneki/.opam/default/lib/fieldslib -I /Users/donviszneki/.opam/default/lib/fmt -I /Users/donviszneki/.opam/default/lib/graphql -I /Users/donviszneki/.opam/default/lib/graphql-lwt -I /Users/donviszneki/.opam/default/lib/graphql_parser -I /Users/donviszneki/.opam/default/lib/ipaddr -I /Users/donviszneki/.opam/default/lib/ipaddr/unix -I /Users/donviszneki/.opam/default/lib/logs -I /Users/donviszneki/.opam/default/lib/lwt -I /Users/donviszneki/.opam/default/lib/magic-mime -I /Users/donviszneki/.opam/default/lib/parsexp -I /Users/donviszneki/.opam/default/lib/ppx_sexp_conv/runtime-lib -I /Users/donviszneki/.opam/default/lib/re -I /Users/donviszneki/.opam/default/lib/re/emacs -I /Users/donviszneki/.opam/default/lib/re/posix -I /Users/donviszneki/.opam/default/lib/result -I /Users/donviszneki/.opam/default/lib/rresult -I /Users/donviszneki/.opam/default/lib/sexplib -I /Users/donviszneki/.opam/default/lib/sexplib0 -I /Users/donviszneki/.opam/default/lib/stringext -I /Users/donviszneki/.opam/default/lib/uchar -I /Users/donviszneki/.opam/default/lib/uri -I /Users/donviszneki/.opam/default/lib/uri/services -I /Users/donviszneki/.opam/default/lib/yojson -I /usr/local/lib/ocaml/threads -I src/shared/.shared.objs -no-alias-deps -o src/server/.main.eobjs/schema.cmo -c -impl src/server/schema.re.ml)
File "src/server/schema.re", line 63, characters 12-59:
Error: This expression has type
         (Shared.Types.todo list, 'a) Lwt_result.t =
           (Shared.Types.todo list, 'a) Result.result Lwt.t
       but an expression was expected of type
         Shared.Types.todo list GQL.Schema.io = Shared.Types.todo list Lwt.t
       Type
         (Shared.Types.todo list, 'a) Result.result =
           (Shared.Types.todo list, 'a) Pervasives.result
       is not compatible with type Shared.Types.todo list
      ocamlc src/server/.main.eobjs/server.{cmi,cmo,cmt}
File "src/server/server.re", line 48, characters 6-40:
Warning 10: this expression should have type unit.
File "src/server/server.re", line 56, characters 6-41:
Warning 10: this expression should have type unit.
File "src/server/server.re", line 80, characters 2-42:
Warning 10: this expression should have type unit.
    ocamlopt src/server/.main.eobjs/server.{cmx,o}
File "src/server/server.re", line 48, characters 6-40:
Warning 10: this expression should have type unit.
File "src/server/server.re", line 56, characters 6-41:
Warning 10: this expression should have type unit.
File "src/server/server.re", line 80, characters 2-42:
Warning 10: this expression should have type unit.
anmonteiro commented 6 years ago

@dvisztempacct I forgot you need a local pin of ocaml-graphql-server. There hasn't been a release in a while and I wanted to use a new feature!

anmonteiro commented 6 years ago

fixed by #3