[day-03] configure router to expose graphql

Expose graphql schema through absinthe plug. Also expose graphiql
interface to make it easier to test graphql schema.
This commit is contained in:
Joao P Dubas 2021-06-24 00:23:34 +00:00
parent 1380b8b2e4
commit a54d29ee61

View File

@ -11,6 +11,13 @@ defmodule WabanexWeb.Router do
get "/", IMCController, :index
end
scope "/api" do
pipe_through :api
forward "/graphql", Absinthe.Plug, schema: WabanexWeb.Schema
forward "/graphiql", Absinthe.Plug.GraphiQL, schema: WabanexWeb.Schema
end
# Enables LiveDashboard only for development
#
# If you want to use the LiveDashboard in production, you should put