lib/rails/graphql/source/active_record/builders.rb
def reflection_to_options(reflection)
          options = { array: reflection.collection? }

          required = options[:array]
          required ||= attr_required?(reflection.name)
          required ||= attr_required?(reflection.association_foreign_key) \
            if reflection.belongs_to? && !reflection.options[:optional]

          options[:nullable] = !options[:array]
          options[:null] = !required
          options
        end
# Transform a replection into a field options
Transform a replection into a field options
Transform a replection into a field options
def reflection_to_options(reflection)
          options = { array: reflection.collection? }
          required = options[:array]
          required ||= attr_required?(reflection.name)
          required ||= attr_required?(reflection.association_foreign_key) \
            if reflection.belongs_to? && !reflection.options[:optional]
          options[:nullable] = !options[:array]
          options[:null] = !required
          options
        end
def reflection_to_options ( reflection ) options = { array : reflection . collection? } required = options [ :array ] required ||= attr_required? ( reflection . name ) required ||= attr_required? ( reflection . association_foreign_key ) if reflection . belongs_to? && ! reflection . options [ :optional ] options [ :nullable ] = ! options [ :array ] options [ :null ] = ! required options end
Transform a replection into a field options
Transform a replection into a field options
reflection