michaelcaterisano
How to add a phase to the Absinthe subscription pipeline?
The pipeline docs say to See Absinthe.Phoenix on adjusting the document pipeline for GraphQL over Phoenix channels, but I don’t see anything about adjusting the pipeline in those docs. How can I add a phase to the Absinthe.Phoenix pipeline?
Most Liked
benwilson512
Hey @michaelcaterisano yeah that does seem to be missing from the docs. Basically, just like plug you do:
pipeline: {SomeModule, :some_function}
Then you have some_function that tweaks the pipeline like it would for a plug.
EDIT: OOPS didn’t see your reply. Yup you have it, PR welcome for the docs!
benwilson512
EDIT: my memory is wrong
@michaelcaterisano Apologies, what you want is:
def some_function(schema, config) do
schema
|> Absinthe.Phoenix.Channel.default_pipeline(config)
|> # do your stuff here.
end
michaelcaterisano
@benwilson512 I’m trying to insert a phase in this pipeline. I tried:
schema
|> Absinthe.Phoenix.Channel.default_pipeline(config)
|> Absinthe.Pipeline.insert_after(Absinthe.Phase.Document.Result, API.Web.GraphQL.Phase.MyPhase)
My phase looks like:
defmodule API.Web.GraphQL.Phase.MyPhase do
@behaviour Absinthe.Phase
@impl Absinthe.Phase
def run(blueprint, _) do
blueprint
end
end
but it doesn’t seem to be reaching my phase. Do I need to be implementing a different behavior here?
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









