Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Jason codec #657

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions guides/plug-phoenix.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Plug and Phoenix Setup

First, install Absinthe.Plug and a JSON codec of your choice,
eg, [Poison](https://hex.pm/packages/poison):
eg, [Jason](https://hex.pm/packages/jason):

```elixir
# filename: mix.exs
def deps do
[
{:absinthe_plug, "~> 1.4"},
{:poison, "~> 2.1.0"},
{:jason, "~> 1.1.0"},
]
end
```
Expand All @@ -28,7 +28,7 @@ you should plug Absinthe.Plug after Plug.Parsers.
```elixir
plug Plug.Parsers,
parsers: [:urlencoded, :multipart, :json, Absinthe.Plug.Parser],
json_decoder: Poison
json_decoder: Jason

plug Absinthe.Plug,
schema: MyAppWeb.Schema
Expand All @@ -51,7 +51,7 @@ defmodule MyApp.Endpoint do
plug Plug.Parsers,
parsers: [:urlencoded, :multipart, :json],
pass: ["*/*"],
json_decoder: Poison
json_decoder: Jason

plug Absinthe.Plug,
schema: MyAppWeb.Schema
Expand Down Expand Up @@ -173,7 +173,7 @@ configure `Plug.Parsers` (or equivalent) to parse the request body before `Absin
plug Plug.Parsers,
parsers: [:urlencoded, :multipart, :json],
pass: ["*/*"],
json_decoder: Poison
json_decoder: Jason
```

For `application/graphql`, the POST body will be parsed as GraphQL query string,
Expand All @@ -191,7 +191,7 @@ As a plug, `Absinthe.Plug` requires very little configuration. If you want to su
plug Plug.Parsers,
parsers: [:urlencoded, :multipart, :json],
pass: ["*/*"],
json_decoder: Poison
json_decoder: Jason

plug Absinthe.Plug,
schema: MyApp.Linen.Schema
Expand Down
2 changes: 1 addition & 1 deletion lib/mix/tasks/absinthe.schema.json.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule Mix.Tasks.Absinthe.Schema.Json do
@shortdoc "Generate a schema.json file for an Absinthe schema"

@default_filename "./schema.json"
@default_codec_name "Poison"
@default_codec_name "Jason"

@moduledoc """
Generate a schema.json file
Expand Down