Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In our application, we are using persisted queries to cut down on network traffic. We have been using this feature for our regular mutations/queries for a while by implementing a Plug to fetch these documents from our document store at runtime when a request comes in with a document id. The payload looks something like this for regular http requests:
I would like to be able to extract the document id from the payload in a subscription
doc
message. I would like to intercept thedoc
message before it hitsAbsinthe.Phoenix.Channel
to swap out the document according to the passed ID, however, there is no apparent way for me to do this easily. I would like to resort to using anAbsinthe.Phase
prepended to the default pipeline to do this work. The problem is that I do not have access to theid
parameter and only have access to thevariables
andquery
. I think it would be beneficial for this scenario (and maybe others) to pass the extra payload parameters to the pipeline via options to allow handling of any extra variables submitted during subscription.