lib/rails/graphql/type_map.rb
def register_alias(name_or_key, key = nil, **xargs, &block)
        raise ArgumentError, <<~MSG.squish unless key.nil? ^ block.nil?
          Provide either a key or a block in order to register an alias.
        MSG

        base_class = xargs.delete(:base_class) || :Type
        ensure_base_class!(base_class)

        namespaces = xargs.delete(:namespaces) || []
        namespaces = namespaces.to_a if namespaces.is_a?(Set)
        namespaces << xargs.delete(:namespace)

        namespaces = namespaces.compact.presence || [:base]

        block ||= -> do
          fetch(key, base_class: base_class, namespaces: namespaces, exclusive: true)
        end

        namespaces.each { |ns| add(ns, base_class, name_or_key, block) }
      end
# Register an item alias. Either provide a block that trigger the fetch
# method to return that item, or a key from the same namespace and base
# class
Register an item alias. Either provide a block that trigger the fetch
method to return that item, or a key from the same namespace and base
class
Register an item alias . Either provide a block that trigger the fetch method to return that item or a key from the same namespace and base class
def register_alias(name_or_key, key = nil, **xargs, &block)
        raise ArgumentError, <<~MSG.squish unless key.nil? ^ block.nil?
          Provide either a key or a block in order to register an alias.
        MSG
        base_class = xargs.delete(:base_class) || :Type
        ensure_base_class!(base_class)
        namespaces = xargs.delete(:namespaces) || []
        namespaces = namespaces.to_a if namespaces.is_a?(Set)
        namespaces << xargs.delete(:namespace)
        namespaces = namespaces.compact.presence || [:base]
        block ||= -> do
          fetch(key, base_class: base_class, namespaces: namespaces, exclusive: true)
        end
        namespaces.each { |ns| add(ns, base_class, name_or_key, block) }
      end
def register_alias ( name_or_key , key = nil , ** xargs , & block ) raise ArgumentError , <<~MSG . squish unless key . nil? ^ block . nil? 
          Provide either a key or a block in order to register an alias.
         MSG base_class = xargs . delete ( :base_class ) || :Type ensure_base_class! ( base_class ) namespaces = xargs . delete ( :namespaces ) || [ ] namespaces = namespaces . to_a if namespaces . is_a? ( Set ) namespaces << xargs . delete ( :namespace ) namespaces = namespaces . compact . presence || [ :base ] block ||= -> do fetch ( key , base_class : base_class , namespaces : namespaces , exclusive : true ) end namespaces . each { | ns | add ( ns , base_class , name_or_key , block ) } end
Register an item alias.
Register an item alias .
name_or_key
key
xargs
block