Class: GraphqlRails::Attributes::InputAttribute

Inherits:
Object
  • Object
show all
Includes:
Attributable, AttributeConfigurable
Defined in:
lib/graphql_rails/attributes/input_attribute.rb

Overview

contains info about single graphql input attribute

Instance Method Summary collapse

Methods included from AttributeConfigurable

#deprecated, #deprecation_reason, #group, #groups, #hidden_in_groups, #optional, #property, #required, #same_as

Methods included from Attributable

#field_name, #graphql_model, #initialize_copy, #name, #optional?, #required?, #scalar_type?, #type_name

Constructor Details

#initialize(name, config:) ⇒ InputAttribute

Returns a new instance of InputAttribute.



17
18
19
20
# File 'lib/graphql_rails/attributes/input_attribute.rb', line 17

def initialize(name, config:)
  @config = config
  @initial_name = name
end

Instance Method Details

#input_argument_argsObject



22
23
24
25
26
# File 'lib/graphql_rails/attributes/input_attribute.rb', line 22

def input_argument_args
  type = raw_input_type || input_type_parser.input_type_arg

  [field_name, type]
end

#input_argument_optionsObject



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/graphql_rails/attributes/input_attribute.rb', line 28

def input_argument_options
  {
    required: required?,
    description: description,
    camelize: false,
    groups: groups,
    hidden_in_groups: hidden_in_groups,
    **default_value_option,
    **property_params,
    **deprecation_reason_params
  }
end

#paginated?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/graphql_rails/attributes/input_attribute.rb', line 41

def paginated?
  false
end