lib/rails/graphql/type/enum.rb
# Use this method to add values to the enum type
#
# ==== Options
#
# * <tt>:desc</tt> - The description of the enum value (defaults to nil).
# * <tt>:directives</tt> - The list of directives associated with the value
#   (defaults to nil).
# * <tt>:deprecated</tt> - A shortcut that auto-attach a @deprecated
#   directive to the value. A +true+ value simple attaches the directive,
#   but provide a string so it can be used as the reason of the deprecation.
#   See {DeprecatedDirective}[rdoc-ref:Rails::GraphQL::Directive::DeprecatedDirective]
#   (defaults to false).
Use this method to add values to the enum type
Options

:desc - The description of the enum value (defaults to nil).
:directives - The list of directives associated with the value
(defaults to nil).
:deprecated - A shortcut that auto-attach a @deprecated
directive to the value. A +true+ value simple attaches the directive,
but provide a string so it can be used as the reason of the deprecation.
Use this method to add values to the enum type Options : desc - The description of the enum value ( defaults to nil ) . : directives - The list of directives associated with the value ( defaults to nil ) . : deprecated - A shortcut that auto - attach a @deprecated directive to the value . A + true + value simple attaches the directive but provide a string so it can be used as the reason of the deprecation .
def add(value, desc: nil, directives: nil, deprecated: false)
            value = value&.to_s
            raise ArgumentError, <<~MSG.squish unless value.is_a?(String) && value.present?
              The "#{value}" is invalid.
            MSG
            value = value.upcase
            raise ArgumentError, <<~MSG.squish if all_values.include?(value)
              The "#{value}" is already defined for #{gql_name} enum.
            MSG
            directives = Array.wrap(directives)
            directives << deprecated_klass.new(
              reason: (deprecated.is_a?(String) ? deprecated : nil),
            ) if deprecated.present?
            directives = GraphQL.directives_to_set(directives,
              location: :enum_value,
              source: self,
            )
            values << value
            value_description[value] = desc unless desc.nil?
            value_directives[value] = directives
          end
def add ( value , desc : nil , directives : nil , deprecated : false ) value = value &. to_s raise ArgumentError , <<~MSG . squish unless value . is_a? ( String ) && value . present? 
              The " #{ value } " is invalid.
             MSG value = value . upcase raise ArgumentError , <<~MSG . squish if all_values . include? ( value ) 
              The " #{ value } " is already defined for  #{ gql_name }  enum.
             MSG directives = Array . wrap ( directives ) directives << deprecated_klass . new ( reason : ( deprecated . is_a? ( String ) ? deprecated : nil ) , ) if deprecated . present? directives = GraphQL . directives_to_set ( directives , location : :enum_value , source : self , ) values << value value_description [ value ] = desc unless desc . nil? value_directives [ value ] = directives end
Use this method to add values to the enum type
 Options
Use this method to add values to the enum type Options
value
desc
directives
deprecated