oliyh / re-graph

A graphql client for clojurescript and clojure
462 stars 40 forks source link

No default instance of re-graph found but no valid instance name was provided #35

Closed priyatam closed 5 years ago

priyatam commented 5 years ago

I'm using your re-partee with a working lacinia backend, where get_countries query returns the same list as repartee.fake.server.fetch-suggestions. However re-frame/re-graph throws an error

What am I missing?

(re-frame/reg-event-fx
    ::fetch-suggestions
    (fn [_ [_ q callback]]
      (js/setTimeout
       (fn []
         (re-frame/dispatch
          [::re-graph/query
           "{
             get_countries(query_str) {
             countries
            }
            }"
           {:query_str q}
           callback]))
       250)
      {}))

error:

No default instance of re-graph found but no valid instance name was provided. Valid instance names are: null but was provided with {
      get_countries(query_str) {
        countries
      }
    } handling event :re-graph.core/query

   re_frame$interceptor$invoke_interceptor_fn | @ | interceptor.cljc?rel=1546286667700:68
  | re_frame$interceptor$invoke_interceptors | @ | interceptor.cljc?rel=1546286667700:10
...
...
Uncaught Error: Invalid arity: 0
    at Object.G__11767 [as call] (core.cljs:6905)
    at component.cljs?rel=1546286662146:97
    at reagent$impl$component$wrap_render (component.cljs?rel=1546286662146:102)
    at reagent$impl$component$do_render (component.cljs?rel=1546286662146:121)
    at re_frame_10x.cljs?rel=1546286687044:61
    at reagent$ratom$in_context (ratom.cljs?rel=1546286661972:37)
    at reagent$ratom$deref_capture (ratom.cljs?rel=1546286661972:43)
    at reagent$ratom$run_in_reaction (ratom.cljs?rel=1546286661972:504)
    at Object.day8$re_frame_10x$mp_render [as render] (re_frame_10x.cljs?rel=15462866870

It would be helpful if you could provide an example query/subscription/mutation integrated with lacinia, since none of the docs/examples provide an end to end graphql implementation. /

Thanks!

priyatam commented 5 years ago

Issue resolved by upgrading from 0.16 to 0.17.