Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/graphql/date_encoding_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class DateEncodingError < GraphQL::RuntimeTypeError

def initialize(value)
@date_value = value
super("Date cannot be parsed: #{value}. \nDate must be be able to be parsed as a Ruby Date object.")
super("Date cannot be parsed: #{value}. \nDate must be able to be parsed as a Ruby Date object.")
end
end
end
2 changes: 1 addition & 1 deletion spec/graphql/types/iso_8601_date_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def parse_date(date_str, context: {})
assert_equal expected_errors, parse_date("xyz").map { |e| e["message"] }
assert_equal expected_errors, parse_date(nil).map { |e| e["message"] }
assert_equal expected_errors, parse_date([1, 2, 3]).map { |e| e["message"] }
assert_equal "A type error was raised: Date cannot be parsed: blah. \nDate must be be able to be parsed as a Ruby Date object.", parse_date("blah", context: { raise_type_error: true })[0]["extensions"]["problems"][0]["explanation"].strip
assert_equal "A type error was raised: Date cannot be parsed: blah. \nDate must be able to be parsed as a Ruby Date object.", parse_date("blah", context: { raise_type_error: true })[0]["extensions"]["problems"][0]["explanation"].strip
assert_equal "Could not coerce value \"blah\" to ISO8601Date", parse_date("blah", context: { raise_type_error: false })[0]["extensions"]["problems"][0]["explanation"]
end

Expand Down
Loading