lib/graphql_rails/attributes/attribute.rb in graphql_rails-2.4.0 vs lib/graphql_rails/attributes/attribute.rb in graphql_rails-3.0.0
- old
+ new
@@ -19,22 +19,16 @@
@initial_name = name
@property = name.to_s
@attributes ||= {}
end
- def property(new_value = NOT_SET)
- return @property if new_value == NOT_SET
-
- @property = new_value.to_s
- self
- end
-
def field_args
[
field_name,
type_parser.type_arg,
- description
+ description,
+ *field_args_options
].compact
end
def field_options
{
@@ -64,9 +58,20 @@
options[:input_format] != :original && options[:attribute_name_format] != :original
end
def deprecation_reason_params
{ deprecation_reason: deprecation_reason }.compact
+ end
+
+ def field_args_options
+ options = { **field_args_pagination_options }
+ return nil if options.empty?
+
+ [options]
+ end
+
+ def field_args_pagination_options
+ pagination_options || {}
end
end
end
end