lib/graphql_rails/attribute.rb in graphql_rails-0.2.3 vs lib/graphql_rails/attribute.rb in graphql_rails-0.2.4

- old
+ new

@@ -35,23 +35,22 @@ private attr_reader :original_name def type_by_attribute_name - type = \ - case name - when 'id', /_id\Z/ - GraphQL::ID_TYPE - when /\?\Z/ - GraphQL::BOOLEAN_TYPE - else - GraphQL::STRING_TYPE - end - - original_name['!'] ? type.to_non_null_type : type + case name + when 'id', /_id\Z/ + GraphQL::ID_TYPE + when /\?\Z/ + GraphQL::BOOLEAN_TYPE + else + GraphQL::STRING_TYPE + end end def parse_type(type) - AttributeTypeParser.new(type).call + type = AttributeTypeParser.new(type).call + + original_name['!'] ? type.to_non_null_type : type end end end