lib/rails/graphql/source/active_record/builders.rb
# Build all necessary attribute fields into the given +holder+
Build all necessary attribute fields into the given +holder+
Build all necessary attribute fields into the given + holder +
def build_attribute_fields(holder, **field_options)
          attributes_as_ids = reflection_attributes(holder)
          each_attribute(holder) do |key, type, **options|
            next if skip.include?(key) || holder.field?(key)
            str_key = key.to_s
            type = (defined?(@enums) && @enums.key?(str_key) && @enums[str_key]) ||
              (attributes_as_ids.include?(str_key) && :id) || type
            options[:null] = !attr_required?(key) unless options.key?(:null)
            holder.field(key, type, **options.merge(field_options[key] || {}))
          end
        end
def build_attribute_fields ( holder , ** field_options ) attributes_as_ids = reflection_attributes ( holder ) each_attribute ( holder ) do | key , type , ** options | next if skip . include? ( key ) || holder . field? ( key ) str_key = key . to_s type = ( defined? ( @enums ) && @enums . key? ( str_key ) && @enums [ str_key ] ) || ( attributes_as_ids . include? ( str_key ) && :id ) || type options [ :null ] = ! attr_required? ( key ) unless options . key? ( :null ) holder . field ( key , type , ** options . merge ( field_options [ key ] || { } ) ) end end
Build all necessary attribute fields into the given +holder+
Build all necessary attribute fields into the given + holder +
holder
field_options