-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
I think this is partly because of
if old_arg.default_value != new_arg.default_value | |
changes << Changes::FieldArgumentDefaultChanged.new(type, field, old_arg, new_arg) | |
end |
I believe default_value
is nil both for the case when it's not set and when it's set to nil, so we might need to add || old_arg.default_value? != new_arg.default_value?
.
Then there's also
graphql-schema_comparator/lib/graphql/schema_comparator/changes.rb
Lines 453 to 460 in 5053197
def message | |
if old_argument.default_value.nil? || old_argument.default_value == :__no_default__ | |
"Default value `#{new_argument.default_value}` was added to argument `#{new_argument.graphql_name}` on field `#{type.graphql_definition}.#{field.graphql_name}`" | |
else | |
"Default value for argument `#{new_argument.graphql_name}` on field `#{type.graphql_definition}.#{field.name}` changed"\ | |
" from `#{old_argument.default_value}` to `#{new_argument.default_value}`" | |
end | |
end |
Which renders poorly when default_value = nil
(since nil becomes the empty string).
(Apologies for only submitting a bug report and not test cases or a PR fixing this. I had some weird issues getting the tests to pass deterministically locally...)
Metadata
Metadata
Assignees
Labels
No labels