-
Notifications
You must be signed in to change notification settings - Fork 529
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
Fix/add tests for compile time default value evaluation #1026
Fix/add tests for compile time default value evaluation #1026
Conversation
@@ -169,7 +169,6 @@ defmodule Absinthe.Blueprint.Schema do | |||
end | |||
|
|||
defp build_types([:close | rest], [%Schema.InputValueDefinition{} = arg, field | stack], buff) do | |||
arg = Map.update!(arg, :default_value, fn val -> {:unquote, [], [val]} end) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seemed to not work, and i'm guess it was supposed to do the evaluation. Clearly it didn't so just removed and used the wrap_in_unquote
function. Tests are passing anyway
test/absinthe/type/object_test.exs
Outdated
|
||
assert type.fields[unquote(test_label)].default_value == unquote(expected_value) | ||
end | ||
end) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the input object's field's default_value is always nil here. Not sure if intentional or not. But i have removed this test in ffb7a0c for the time being
@binaryseed Would this be able to make it into 1.6? I found this issue testing 1.6.0-rc-0 on my company's codebase |
@@ -1,68 +1,51 @@ | |||
defmodule Absinthe.Type.QueryTest do | |||
use Absinthe.Case, async: true | |||
|
|||
defmodule TestSchema do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to fixtures
Thanks for this! |
No description provided.