lib/rails/graphql/type/union.rb
def append(*others)
            return if others.blank?

            others.flatten!
            others.map! do |item|
              next item unless item.is_a?(Symbol)
              GraphQL.type_map.fetch(item, namespaces: namespaces)
            end

            checker = others.lazy.map { |item| item.try(:base_type) }.uniq.force
            raise ArgumentError, <<~MSG.squish unless checker.size === 1
              All the union members must be of the same base class.
            MSG

            check_types = members? ? [members.first.base_type] : VALID_MEMBER_TYPES
            raise ArgumentError, <<~MSG.squish unless (check_types & checker).size === 1
              A union cannot contain members of different base classes.
            MSG

            members.concat(others)
          end
# Use this method to add members to the union
Use this method to add members to the union
Use this method to add members to the union
def append(*others)
            return if others.blank?
            others.flatten!
            others.map! do |item|
              next item unless item.is_a?(Symbol)
              GraphQL.type_map.fetch(item, namespaces: namespaces)
            end
            checker = others.lazy.map { |item| item.try(:base_type) }.uniq.force
            raise ArgumentError, <<~MSG.squish unless checker.size === 1
              All the union members must be of the same base class.
            MSG
            check_types = members? ? [members.first.base_type] : VALID_MEMBER_TYPES
            raise ArgumentError, <<~MSG.squish unless (check_types & checker).size === 1
              A union cannot contain members of different base classes.
            MSG
            members.concat(others)
          end
def append ( * others ) return if others . blank? others . flatten! others . map! do | item | next item unless item . is_a? ( Symbol ) GraphQL . type_map . fetch ( item , namespaces : namespaces ) end checker = others . lazy . map { | item | item . try ( :base_type ) } . uniq . force raise ArgumentError , <<~MSG . squish unless checker . size === 1 
              All the union members must be of the same base class.
             MSG check_types = members? ? [ members . first . base_type ] : VALID_MEMBER_TYPES raise ArgumentError , <<~MSG . squish unless ( check_types & checker ) . size === 1 
              A union cannot contain members of different base classes.
             MSG members . concat ( others ) end
Use this method to add members to the union
Use this method to add members to the union
others