oliyh / re-graph

A graphql client for clojurescript and clojure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trying to connect to wrong WebSocket after ::re-graph/init

opened this issue · comments

We dispatch ::re-graph/init with:

{:ws-url "ws://localhost:8888/graphql-ws"
 :http-url "http://localhost:8888/graphql"
 ...}

With re-graph 0.1.6 the re-frame database contains afterwards:

:re-graph {
  {:ws-url "ws://localhost:8888/graphql-ws"
   :http-url "http://localhost:8888/graphql"
   ...}; This is REALLY the key of the following value!
  {:websocket {:url "ws://localhost:9500/graphql-ws" ...}
   :http-url "/graphql"
   ...}
}

With 0.1.4 and otherwise the same code the database would contain:

:re-graph {
  :websocket {:url "ws://localhost:8888/graphql-ws" ...}
  :http-url "http://localhost:8888/graphql"
  ...
}

Hi,

Yes I just realised this the other day. You can add an additional argument nil at the 0 index i.e.

(re-frame/dispatch [::re-graph/init nil {opts...}])

Or else use the re-graph/init function which has two arities.

What is the status of this? Is a bugfix release planned?

Hi,

Yes I think I will fix this, I should be able to find time in the next two days.

Cheers

Hi @urzds this is fixed in 0.1.7

Thanks for reporting.

Thanks for the fix!