Elixir version (elixir -v): Elixir 1.13.4 (compiled with Erlang/OTP 24)
Absinthe version (mix deps | grep absinthe): master
Client Framework and version (Relay, Apollo, etc): N/A
Expected behavior
When generating SDL via mix absinthe.schema.sdl --schema ... Absinthe does not include any fields or input args etc. with the default_value keyword. With the test Absinthe schema below, the task outputs:
defmodule MyTestSchema do
use Absinthe.Schema
query do
field :item, :string do
arg :show, :boolean, default_value: true
end
end
mutation do
field :create_item, :string do
arg :input, non_null(:test_input)
arg :other, :string, default_value: "other"
end
end
input_object :test_input do
field :value, non_null(:string), default_value: "test"
end
end
The absinthe.schema.json does however have the default values in it
defmodule MyTestSchema do
use Absinthe.Schema
query do
field :item, :string do
arg :show, :boolean, default_value: true
end
end
mutation do
field :create_item, :string do
arg :input, non_null(:test_input)
arg :other, :string, default_value: "other"
end
end
input_object :test_input do
field :value, non_null(:string), default_value: "test"
end
end
This test I wrote for test/mix/tasks/absinthe.schema.sdl_test.exs fails but I would expect the strings to all be present.
test "with a default input" do
argv = ["ouput.graphql", "--schema", "#{MyTestSchema}"]
opts = Task.parse_options(argv)
{:ok, schema} = Task.generate_schema(opts)
assert schema =~ "value: String! = \"test\""
assert schema =~ "other: String = \"other\""
assert schema =~ "show: Boolean = true"
end
Environment
Expected behavior
When generating SDL via
mix absinthe.schema.sdl --schema ...
Absinthe does not include any fields or input args etc. with thedefault_value
keyword. With the test Absinthe schema below, the task outputs:Task output:
Test absinthe schema:
Actual behavior
The generator returns
Relevant Schema/Middleware Code
Test schema I used
This test I wrote for
test/mix/tasks/absinthe.schema.sdl_test.exs
fails but I would expect the strings to all be present.