In Absinthe is it possible to publish a message only to the client subscribing right now?

There’s a GraphQL subscription in my app that most of the time publishes only partially filled objects (diffs or changes), and rarely publishes fully populated objects. When a change arrives, the subscriber has a state with a full object in it, and updates the object with the changing fields. The unchanged parts are retained for a while to save some bandwidth.

The problem with this approach is that a new subscriber has to wait until a fully populated object arrives. The changes have no meaning without a preceding full object.

Is it possible to send the whole object to the subscriber when the subscription is established without sending the data to other subscribers?

I’ve never used Absinthe but I checked the documentation for you and it should be possible to set a flag when first connecting. Then in your resolver, depending on the flag you can send a full object or a partial one.

1 Like