Fork me on GitHub

I think some of the changed in lacinia 1.2 broke subscriptions. I have part of the fix in lacinia-pedestal, but I may need to change lacinia to make it fully work and work properly. This has me bummed.


Essentially, for subscriptions, lacinia-pedestal invokes the streamer for the subscription field (e.g., Subscription/ticks in the, passing it a source-stream callback function. The thread started by the streamer function passes a value to the callback, which becomes the resolved-value when executing the query. That's a problem, because the query selection is for the subscription field (Subscription/ticks) but the value is a tick object. So the selection is right, but the value is wrong; it has to be wrapped with the fields name (:ticks in this case) so that when the query executes, there's a non-null value to perform sub-selections on (the :count and :time_ms fields from the selection).


That works for the success case, but if the callback is passed a wrapped value (such as via with-error) then things are not working correctly; the errors are ignored and lacina then performs the sub-selections on a nil value, triggering validation errors about non-null fields.


So the layers of indirection are making me dizzy, but I'm sure there's a solution here, somewhere.


It's possible I can detect if it's a wrapped value and re-wrap it if so.


But I want it to be clean, to support subscription implementations for other HTTP implementations besides Pedestal.


And clean may not be possible with out a change to lacinia.