graphql

2022-08-01T16:36:00.242949Z

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?

2022-08-01T18:29:51.772159Z

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

2022-08-01T18:30:23.947599Z

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

2022-08-01T19:10:24.616939Z

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.

2022-08-01T19:12:47.064269Z

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

(re-frame/reg-event-fx
 :table/set-counts-for-dates
 [(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
                                     :query-counts-for-date
                                     "($date: ID!){countsForDate (date: $date) {aircraftPatternCount flightCount}}"
                                     {:date date}
                                     [:table/set-counts-for-single-date]]]) dates)]
     {:fx fx-list})))

2022-08-01T19:13:35.816409Z

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

2022-08-01T19:13:53.994289Z

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

2022-08-01T19:14:00.513219Z

ohhhh

2022-08-01T19:14:05.610589Z

thank you!!!

2022-08-01T19:14:28.337249Z

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

2022-08-01T19:15:16.624579Z

That did it! Thanks! I love your library

2022-08-01T19:15:23.728279Z

😊