Skip to content

Instantly share code, notes, and snippets.

@bruce
Created January 9, 2017 08:49
Show Gist options
  • Save bruce/9e9f26a278aefd462dff40cd5cf4853c to your computer and use it in GitHub Desktop.
Save bruce/9e9f26a278aefd462dff40cd5cf4853c to your computer and use it in GitHub Desktop.
Showing float serialization to non-string
defmodule TestSchema do
use Absinthe.Schema
query do
field :hello, :float do
resolve fn _, _, _ -> {:ok, 1.3} end
end
end
end
{:ok, result} = Absinthe.run("{ hello }", Tester)
~s({"data":{"hello":1.3}}) = Poison.encode!(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment