absinthe-graphql/absinthe_phoenix

Error "function nil.subscribe/1 is undefined or private"

macabeus opened this issue · 1 comments

I'm trying to use this package in my project, but I can't run any subscription, even the example.
I receive this error message:

[debug] ABSINTHE schema=MyApp.Schema variables=%{}
---
subscription {
  commentAdded(repoFullName: "foo") {
    title
  }
}
---
[info] Sent 500 in 134ms
[error] #PID<0.518.0> running MyApp.Endpoint terminated
Server: localhost:4000 (http)
Request: POST /api
** (exit) an exception was raised:
    ** (UndefinedFunctionError) function nil.subscribe/1 is undefined or private
        nil.subscribe("__absinthe__:doc:52740976")
        (absinthe_plug) lib/absinthe/plug.ex:218: Absinthe.Plug.subscribe/3
        (phoenix) lib/phoenix/router/route.ex:161: Phoenix.Router.Route.forward/4
        (phoenix) lib/phoenix/router.ex:278: Phoenix.Router.__call__/1
        (myapp) lib/myapp/endpoint.ex:1: MyApp.Endpoint.plug_builder_call/2
        (myapp) lib/plug/debugger.ex:99: MyApp.Endpoint."call (overridable 3)"/2
        (myapp) lib/myapp/endpoint.ex:1: MyApp.Endpoint.call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) /Users/macabeus/Dropbox (BEPiD)/myapp/server/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4

My mix deps:

[
  {:phoenix, "~> 1.3.0"},
  {:phoenix_pubsub, "~> 1.0"},
  {:phoenix_ecto, "~> 3.2"},
  {:ecto_enum, ">= 0.0.0"},
  {:postgrex, ">= 0.0.0"},
  {:phoenix_html, "~> 2.10"},
  {:phoenix_live_reload, "~> 1.0", only: :dev},
  {:gettext, "~> 0.11"},
  {:cowboy, "~> 1.0"},
  {:absinthe, "~> 1.4.0-rc.3"},
  {:absinthe_plug, "~> 1.4.0-rc.1"},
  {:absinthe_ecto, "~> 0.1.2"},
  {:absinthe_phoenix, github: "absinthe-graphql/absinthe_phoenix"},
  {:poison, "~> 3.1"},
  {:faker, "~> 0.9.0"},
  {:timex, "~> 3.1"}
]

I really don't know the reason of this error.

Fixed! I need use the simple UI.
I din't read the line "At this time only the simpler GraphiQL interface supports subscriptions."...