All Projects → absinthe-graphql → Absinthe_plug

absinthe-graphql / Absinthe_plug

Licence: mit
Plug support for Absinthe, the GraphQL toolkit for Elixir

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Absinthe plug

guardian trackable
A Guardian hook to track user sign ins.
Stars: ✭ 25 (-88.04%)
Mutual labels:  phoenix, plug
Terraform
A simple plug for incrementally transforming an API into Phoenix. Check out the blog post:
Stars: ✭ 379 (+81.34%)
Mutual labels:  phoenix, plug
accent
Dynamically convert the case of your JSON API keys
Stars: ✭ 27 (-87.08%)
Mutual labels:  phoenix, plug
alternate
Plug and Phoenix helpers to localize your web app via the URL
Stars: ✭ 26 (-87.56%)
Mutual labels:  phoenix, plug
Yummy Phoenix Graphql
Cooking recipe sharing app built with Phoenix, React, GraphQL and Kubernetes
Stars: ✭ 112 (-46.41%)
Mutual labels:  graphql, phoenix
plug rest
REST behaviour and Plug router for hypermedia web applications in Elixir
Stars: ✭ 52 (-75.12%)
Mutual labels:  phoenix, plug
Guardian
Elixir Authentication
Stars: ✭ 3,150 (+1407.18%)
Mutual labels:  phoenix, plug
phoenix-client-ssl
Set of Plugs / Lib to help with SSL Client Auth.
Stars: ✭ 18 (-91.39%)
Mutual labels:  phoenix, plug
Authex
Authex is an opinionated JWT authentication and authorization library for Elixir.
Stars: ✭ 73 (-65.07%)
Mutual labels:  phoenix, plug
Liberator
An Elixir library for building RESTful applications.
Stars: ✭ 28 (-86.6%)
Mutual labels:  phoenix, plug
plug rails cookie session store
Rails compatible Plug session store
Stars: ✭ 93 (-55.5%)
Mutual labels:  phoenix, plug
Logster
Easily parsable single line, plain text and JSON logger for Plug and Phoenix applications
Stars: ✭ 171 (-18.18%)
Mutual labels:  phoenix, plug
Elixir Boilerplate
⚗ The stable base upon which we build our Elixir projects at Mirego.
Stars: ✭ 627 (+200%)
Mutual labels:  graphql, plug
Captain Fact Api
🔎 CaptainFact - API. The one that serves and process all the data for https://captainfact.io
Stars: ✭ 145 (-30.62%)
Mutual labels:  graphql, phoenix
Appsignal Elixir
🟪 AppSignal for Elixir package
Stars: ✭ 176 (-15.79%)
Mutual labels:  phoenix, plug
Graphql Doctor
Prevent Breaking Changes in a GraphQL API with GitHub Checks
Stars: ✭ 203 (-2.87%)
Mutual labels:  graphql
Lighthouse
A framework for serving GraphQL from Laravel
Stars: ✭ 2,685 (+1184.69%)
Mutual labels:  graphql
Django Graphql Auth
Django registration and authentication with GraphQL.
Stars: ✭ 200 (-4.31%)
Mutual labels:  graphql
Magellan
Real-time streaming GraphQL server for Go.
Stars: ✭ 202 (-3.35%)
Mutual labels:  graphql
Formex
A better form library for Phoenix
Stars: ✭ 206 (-1.44%)
Mutual labels:  phoenix

Absinthe Plug

Build Status Hex pm Hex Docs License

Plug support for Absinthe, the GraphQL toolkit for Elixir.

Please see the website at http://absinthe-graphql.org.

Installation

Install from Hex.pm:

def deps do
  [{:absinthe_plug, "~> 1.5"}]
end

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"}
  ]
end

Usage

Basic Usage:

plug Plug.Parsers,
  parsers: [:urlencoded, :multipart, :json, Absinthe.Plug.Parser],
  pass: ["*/*"],
  json_decoder: Jason

plug Absinthe.Plug,
  schema: MyAppWeb.Schema

If you want Absinthe.Plug to serve only a particular route, configure your 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.

Phoenix.Router

If you are using Phoenix.Router, forward expects different arguments:

Plug.Router

forward "/graphiql",
  to: Absinthe.Plug.GraphiQL,
  init_opts: [
    schema: MyAppWeb.Schema,
    interface: :simple
  ]

Phoenix.Router

forward "/graphiql",
  Absinthe.Plug.GraphiQL,
  schema: MyAppWeb.Schema,
  interface: :simple

For more information see Phoenix.Router.forward/4.

GraphiQL

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.

Documentation

See HexDocs.

More Help

Related Projects

See the project list at https://github.com/absinthe-graphql.

License

See LICENSE.md.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].