lib/rails/graphql/type/union.rb
def validate!(*)
            super if defined? super

            members = all_members
            raise ArgumentError, <<~MSG.squish unless members.size >= 1
              A union must contain at least one member.
            MSG

            size = members.lazy.map(&:base_type).uniq.force.size
            raise ArgumentError, <<~MSG.squish unless size.eql?(1)
              All the members of the union must contain the same base class.
            MSG
          end
# Check if the union definition is valid
Check if the union definition is valid
Check if the union definition is valid
def validate!(*)
            super if defined? super
            members = all_members
            raise ArgumentError, <<~MSG.squish unless members.size >= 1
              A union must contain at least one member.
            MSG
            size = members.lazy.map(&:base_type).uniq.force.size
            raise ArgumentError, <<~MSG.squish unless size.eql?(1)
              All the members of the union must contain the same base class.
            MSG
          end
def validate! ( * ) super if defined? super members = all_members raise ArgumentError , <<~MSG . squish unless members . size >= 1 
              A union must contain at least one member.
             MSG size = members . lazy . map ( & :base_type ) . uniq . force . size raise ArgumentError , <<~MSG . squish unless size . eql? ( 1 ) 
              All the members of the union must contain the same base class.
             MSG end
Check if the union definition is valid
Check if the union definition is valid