absinthe_plug v1.3.0-beta.1 Absinthe.Plug.GraphiQL

<<<<<<< HEAD Provides a GraphiQL interface.

Examples

Serve the GraphiQL “advanced” interface at /graphiql, but only in development:

if Mix.env == :dev do
  forward "/graphiql",
    Absinthe.Plug.GraphiQL,
    schema: MyApp.Schema
end

Use the “simple” interface (original GraphiQL) instead:

if Mix.env == :dev do
  forward "/graphiql",
    Absinthe.Plug.GraphiQL,
    schema: MyApp.Schema,
    interface: :simple
end

Interface Selection

The GraphiQL interface can be switched using the :interface option.

  • :advanced (default) will serve the GraphiQL Workspace interface from Oleg Ilyenko.
  • :simple will serve the original GraphiQL interface from Facebook.

See Absinthe.Plug for the other options.

Summary

Types

opts()
opts() :: [schema: atom, adapter: atom, path: binary, context: map, json_codec: atom | {atom, Keyword.t}, interface: :advanced | :simple]