retro / graphql-builder

GraphQL client library for Clojure and ClojureScript
MIT License
184 stars 15 forks source link

lib doesn't work from cljs #5

Closed kurt-o-sys closed 6 years ago

kurt-o-sys commented 6 years ago

Not sure if this is known or if I'm using it wrong, but the library doesn't work from cljs:

With

                 [floatingpointio/graphql-builder "0.1.4" :exclusions [graphql-clj]]
                 [graphql-clj "0.2.6"]             

and

(ns ...
  (:require ...
            [graphql-builder.parser :refer-macros [defgraphql]]
            [graphql-builder.core :refer [query-map]]))

(defgraphql graphql-queries ...)
(def query-map (query-map graphql-queries))

results in:

Failed to compile "target/cljsbuild/public/js/app.js" in 38.341 seconds.
----  Could not Analyze  ...  ----

  java.io.FileNotFoundException: Could not locate graphql_clj/box__init.class or graphql_clj/box.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name., compiling:(graphql_builder/parser.clj:1:1)

----  Analysis Error : Please see ...  ----

If I'm not updating to the last version of graphql-clj:

Failed to compile "target/cljsbuild/public/js/app.js" in 34.869 seconds.
----  Could not Analyze  ...  ----

  java.lang.RuntimeException: No such var: insta/add-line-and-column-info-to-metadata, compiling:(graphql_clj/parser.clj:117:21)

----  Analysis Error : Please see ...  ----
retro commented 6 years ago

@kurt-o-sys Hey, can you create a minimal breaking example? I'm using this lib from CLJS every day without any issues

kurt-o-sys commented 6 years ago

oh, I'll give it a try.

kurt-o-sys commented 6 years ago

ok, I guess I found it: conflicting with: [compojure "1.6.0"]

$ lein deps :tree
...
[compojure "1.6.0"] -> [clout "2.1.2"] -> [instaparse "1.4.0" :exclusions [org.clojure/clojure]]
 overrides
[floatingpointio/graphql-builder "0.1.4"] -> [graphql-clj "0.1.20"] -> [instaparse "1.4.3"]
...

FIX: exclude instaparse from compojure in dependencies in project.clj:

[compojure "1.6.0" :exclusions [instaparse]]