Skip to content

Commit edc53c8

Browse files
committed
Reverse string validity checks
1 parent d7e0cb0 commit edc53c8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/graphql/types/string.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class String < GraphQL::Schema::Scalar
77

88
def self.coerce_result(value, ctx)
99
str = value.to_s
10-
if str.ascii_only? || str.encoding == Encoding::UTF_8
10+
if str.encoding == Encoding::UTF_8 || str.ascii_only?
1111
str
1212
elsif str.frozen?
1313
str.encode(Encoding::UTF_8)

0 commit comments

Comments
 (0)