oliyh / re-graph

A graphql client for clojurescript and clojure
460 stars 39 forks source link

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

Closed BorisKourt closed 2 years ago

BorisKourt commented 2 years ago

I am triggering the following: https://github.com/oliyh/re-graph/blob/master/src/re_graph/internals.cljc#L103

But only in production and not in development. Am I missing some key bit of configuration?

"No default instance of re-graph found but no valid instance name was provided. Valid instance names are:" nil "but was provided with" :named-instance "handling event" :re-graph.core/query

There is an older issue with the same error but I don't think its related: https://github.com/oliyh/re-graph/issues/35

BorisKourt commented 2 years ago

The issue was during startup in my application. rg/init never had the chance to run, and later I was trying to do an operation on it un-initialized. That is why it says 'valid instance names are: nil'.

oliyh commented 2 years ago

Hello,

Sorry I didn't get round to helping you in time, well done for finding the issue. The error message could probably be a bit more helpful, like telling you that re-graph isn't initialised yet, separate to the error you got which would also be shown for an initialised re-graph for which you give the wrong instance key. I'll reopen this issue to track that change.

BorisKourt commented 2 years ago

Thanks!

oliyh commented 2 years ago

Hi, this is improved in 0.1.18-SNAPSHOT