1.2.5 - This version may not be safe as it has not been updated for a long time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform
Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.
BSD-3-Clause - BSD 3-Clause "New" or "Revised" LicensePlug support for Absinthe, the GraphQL toolkit for Elixir.
Please see the website at http://absinthe-graphql.org.
Install from Hex.pm:
def deps do
[{:absinthe_plug, "~> 1.5"}]
endNote: Absinthe.Plug requires Elixir 1.10 or higher.
Absinthe.Plug also requires a JSON codec. Jason and Poison work out of the box.
def deps do
[
...,
{:absinthe_plug, "~> 1.5"},
{:jason, "~> 1.0"}
]
endSee CHANGELOG for upgrade steps between versions.
You may want to look for the specific upgrade guide in the Absinthe documentation.
See "Usage," below, for basic usage information and links to specific resources.
See the GitHub organization.
In your MyAppWeb.Router module add:
plug Plug.Parsers,
parsers: [:urlencoded, :multipart, :json, Absinthe.Plug.Parser],
pass: ["*/*"],
json_decoder: Jason
plug Absinthe.Plug,
schema: MyAppWeb.SchemaIf you want Absinthe.Plug to serve only a particular route, configure your
MyAppWeb.Router like:
plug Plug.Parsers,
parsers: [:urlencoded, :multipart, :json, Absinthe.Plug.Parser],
pass: ["*/*"],
json_decoder: Jason
forward "/api",
to: Absinthe.Plug,
init_opts: [schema: MyAppWeb.Schema]For more information, see the API documentation for Absinthe.Plug.
If you are using Phoenix.Router, forward expects different arguments:
forward "/graphiql",
to: Absinthe.Plug.GraphiQL,
init_opts: [
schema: MyAppWeb.Schema,
interface: :simple
]forward "/graphiql",
Absinthe.Plug.GraphiQL,
schema: MyAppWeb.Schema,
interface: :simpleFor more information see Phoenix.Router.forward/4.
To add support for a GraphiQL interface, add a configuration for
Absinthe.Plug.GraphiQL:
forward "/graphiql",
to: Absinthe.Plug.GraphiQL,
init_opts: [schema: MyAppWeb.Schema]See the API documentation for Absinthe.Plug.GraphiQL for more information.
The project is under constant improvement by a growing list of
contributors, and your feedback is important. Please join us in Slack
(#absinthe-graphql under the Elixir Slack account) or the Elixir Forum
(tagged absinthe).
Please remember that all interactions in our official spaces follow our Code of Conduct.
Please follow contribution guide.
See LICENSE.md.