Updated documentation on Connect your schema - Using Plug (#6)

This commit is contained in:
Pedro Candeias 2020-10-10 02:16:40 +01:00 committed by GitHub
parent 77566d96c4
commit d427e39d15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -93,12 +93,16 @@ adding plug to your application.
Then you can use a `Plug.Router` and [forward](https://hexdocs.pm/plug/Plug.Router.html#forward/2) to your plugs similar to how it is done for phoenix:
```elixir
forward "/gql", Absinthe.Plug, schema: YourSchema
forward "/gql",
to: Absinthe.Plug,
init_opts: [schema: YourSchema]
forward "/playground",
Absinthe.Plug.GraphiQL,
schema: YourSchema
interface: :playground
to: Absinthe.Plug.GraphiQL,
init_opts: [
schema: YourSchema,
interface: :playground
]
```
### Using Phoenix