Skip to content

Commit

Permalink
Switch from Poison to Jason.
Browse files Browse the repository at this point in the history
  • Loading branch information
ospaarmann committed Aug 7, 2019
1 parent 629c6ab commit e35f509
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ request = ExDgraph.Api.Request.new(query: query)
{:ok, msg} = channel |> ExDgraph.Api.Dgraph.Stub.query(request)

# Parse result
json = Poison.decode!(msg.json)
json = Jason.decode!(msg.json)
```

## Using SSL
Expand Down
2 changes: 1 addition & 1 deletion lib/exdgraph.ex
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ defmodule ExDgraph do
{:ok, msg} = channel |> ExDgraph.Api.Dgraph.Stub.query(request)
# Parse result
json = Poison.decode!(msg.json)
json = Jason.decode!(msg.json)
```
## Using SSL
Expand Down
4 changes: 2 additions & 2 deletions lib/exdgraph/mutation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ defmodule ExDgraph.Mutation do
@doc false
def set_map(conn, map) do
map_with_tmp_uids = insert_tmp_uids(map)
json = Poison.encode!(map_with_tmp_uids)
json = Jason.encode!(map_with_tmp_uids)

case set_map_commit(conn, json, map_with_tmp_uids) do
{:ok, r} ->
Expand All @@ -54,7 +54,7 @@ defmodule ExDgraph.Mutation do
@doc false
def set_struct(conn, struct) do
uids_and_schema_map = set_tmp_ids_and_schema(struct)
json = Poison.encode!(uids_and_schema_map)
json = Jason.encode!(uids_and_schema_map)

case set_struct_commit(conn, json, uids_and_schema_map) do
{:ok, r} ->
Expand Down
2 changes: 1 addition & 1 deletion lib/exdgraph/transform.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule ExDgraph.Transform do
keys into atom keys.
"""
def transform_query(%ExDgraph.Api.Response{json: json, schema: schema, txn: txn}) do
decoded = Poison.decode!(json)
decoded = Jason.decode!(json)

transformed =
case Morphix.atomorphiform(decoded) do
Expand Down
2 changes: 1 addition & 1 deletion lib/exdgraph/utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule ExDgraph.Utils do

def as_rendered(value) do
case value do
x when is_list(x) -> x |> Poison.encode!()
x when is_list(x) -> x |> Jason.encode!()
%Date{} = x -> x |> Date.to_iso8601() |> Kernel.<>("T00:00:00.0+00:00")
%DateTime{} = x -> x |> DateTime.to_iso8601() |> String.replace("Z", "+00:00")
x -> x |> to_string
Expand Down
14 changes: 7 additions & 7 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ defmodule ExDgraph.MixProject do
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:db_connection, "~> 2.1"},
{:elixir_uuid, "~> 1.2"},
{:grpc, "~> 0.3.1"},
{:jason, "~> 1.1"},
{:morphix, "~> 0.6.0"},
{:protobuf, "~> 0.6.1"},
{:poison, "~> 3.1"},
{:db_connection, "~> 2.1"},
{:retry, "~> 0.11.2"},
{:morphix, "~> 0.6.0"},
{:ex_doc, "~> 0.19.0", only: :dev, runtime: false},
{:elixir_uuid, "~> 1.2"},
{:mix_test_watch, "~> 0.5", only: :dev, runtime: false},
{:excoveralls, "~> 0.10", only: :test},
{:credo, "~> 1.0", only: [:dev, :test], runtime: false}
{:credo, "~> 1.0", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.19.0", only: :dev, runtime: false},
{:mix_test_watch, "~> 0.5", only: :dev, runtime: false}
]
end

Expand Down

0 comments on commit e35f509

Please sign in to comment.