Fork me on GitHub
Daniel Craig16:08:00

Hi all, I'm attempting to load about 30 rows of table data as individual re-graph queries and I am seeing that my queries don't complete and I can see in reframe-10x that a regraph.internals/register-abort event is being handled - are my queries being aborted? what can I do about this?


No, that is just an implementation detail for supporting the abort feature, it doesn't mean it's been run


Are you using websockets or http? Are all the requests being made / returning success?

Daniel Craig19:08:24

I'm using http, and it looks like only one of my requests is actually being made, thanks for the tip to check the requests.

Daniel Craig19:08:47

This is what I have in the effect handler that's supposed to be dispatching one query per date:

 [(re-frame/inject-cofx ::inject/sub [:table/dates])]
 (fn [{db :db dates :table/dates} event]
   (let [fx-list (mapv (fn [date]
                         [:dispatch [::re-graph/query
                                     "($date: ID!){countsForDate (date: $date) {aircraftPatternCount flightCount}}"
                                     {:date date}
                                     [:table/set-counts-for-single-date]]]) dates)]
     {:fx fx-list})))

Daniel Craig19:08:35

But it's only dispatching the first ::re-graph/query event


Ah, you are setting the query id as :query-counts-for-date on each one. Re-graph is deduping them for you


Make the id unique (or omit it altogether, if you don't refer to it elsewhere)

Daniel Craig19:08:16

That did it! Thanks! I love your library