I’m still working on the batching query execution engine, but there is already a repo: https://github.com/vlaaad/plusinia You can have a look at tests for some examples. It works! Batches by field+args, supports interfaces and unions…
I’m talking about this
Hey!
I have an issue with re-graph subscriptions. After subscribing, I actually get the first message via websocket, but then no more events.
It seems, that the value :subscriptions of app-db is just an empty map (see screenshot), and does not contain the subscription, as I think it should be (concluding from https://github.com/oliyh/re-graph/issues/42).
(re-frame/reg-event-db
::on-thing
[(when ^boolean goog.DEBUG re-frame/debug)]
(fn [db [_ {:keys [data errors] :as payload}]]
(js/console.log "message:" payload)
(js/console.log "db:" (clj->js db))
db))
(re-frame/dispatch-sync
[::re-graph/init
{:ws {:url (str ")
:sub-protocol "graphql-ws"
:reconnect-timeout 500
:resume-subscriptions? true
:connection-init-payload {:token account
:csrf csrf}
:impl {:headers {"Authorization" (str "Bearer " account)
"Authorization-CSRF" csrf}}
:supported-operations #{:subscribe
:query
:mutate}}
:http {:url ""
:impl {:headers {"Authorization" (str "Bearer " account)
"Authorization-CSRF" csrf}}
:supported-operations #{:query
:mutate}}}])
(re-frame/dispatch-sync [::re-graph/subscribe
:my-subscription-id
MESSAGES_SUBSCRIPTION
{:targetIds ["ZKFETo4fAfHMuCAfXrud1AKhq5MMm4akpqcb5T8qjgxSFaShyUZYCEH65755"]}
[::on-thing]]) :ready? is true , as it is supposed to be, I think.
The state of re-graph looks correct
If you inspect the websocket from the network tab, what messages do you see?
My guess at the moment is your subscription is finishing and sending a stop message down the websocket, which results in the subscription being cleaned up
Not sure it's of any help, but this is an example of subscriptions working, https://github.com/gklijs/bkes-demo.
Thank you for your hints! It really was the case, that the stream sent a {type: "complete"} message and subscription subsequently ended.