How to add a phase to the Absinthe subscription pipeline?

Oh sorry I didn’t put 2 and 2 together!

The root issue you aren’t gonna get around is this: absinthe/lib/absinthe/subscription/local.ex at main · absinthe-graphql/absinthe · GitHub

At the end of the day the GraphQL doc needs to return a result or the background publisher will crash, and then it’s going to unconditionally publish that result. These results are fastlaned for performance, so you can’t even easily filter them out in the channel.

This is from your other thread but yeah, Absinthe wraps the publication call in a try so that the mutation that is triggering the publish doesn’t crash just cause a subscription fails. You can see that rescue actually in the code I linked above.

A quick and dirty answer here would be to fork Absinthe and change that code to look at some value and have it not publish.

I think your overall goal here is a good one and one that Absinthe should support. I can’t promise a timeline on when it will though.