Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- defmodule CoryWeb.Router do
- use CoryWeb, :router
- defmodule SchemaOnePlug do
- def init(_), do: Absinthe.Plug.init(schema: CoryWeb.SchemaOne)
- def call(conn, opts), do: Absinthe.Plug.call(conn, opts)
- end
- defmodule SchemaTwoPlug do
- def init(_), do: Absinthe.Plug.init(schema: CoryWeb.SchemaTwo)
- def call(conn, opts), do: Absinthe.Plug.call(conn, opts)
- end
- pipeline :graphql do
- plug Plug.Parsers,
- parsers: [:urlencoded, :multipart, :json, Absinthe.Plug.Parser],
- json_decoder: Poison
- end
- scope "/one", as: :one do
- pipe_through :graphql
- forward "/", SchemaOnePlug
- end
- scope "/two", as: :two do
- pipe_through :graphql
- forward "/", SchemaTwoPlug
- end
- end
Add Comment
Please, Sign In to add comment