lib/rails/graphql/type_map.rb
# Find the given key or name inside the base class either on the given
# namespace or in the base +:base+ namespace
Find the given key or name inside the base class either on the given
namespace or in the base +:base+ namespace
Find the given key or name inside the base class either on the given namespace or in the base + : base + namespace
def fetch(key_or_name, prevent_register: nil, **xargs)
        if prevent_register != true
          skip_register << Array.wrap(prevent_register)
          register_pending!
        end
        namespaces = xargs[:namespaces]
        namespaces = namespaces.is_a?(Set) ? namespaces.to_a : Array.wrap(namespaces)
        namespaces += [:base] unless xargs.fetch(:exclusive, false)
        possibilities = Array.wrap(key_or_name)
        possibilities += Array.wrap(xargs[:fallback]) if xargs.key?(:fallback)
        namespaces.uniq.find do |namespace|
          possibilities.find do |item|
            result = dig(namespace, xargs.fetch(:base_class, :Type), item)
            return result.call unless result.nil?
          end
        end
      ensure
        skip_register.pop
      end
def fetch ( key_or_name , prevent_register : nil , ** xargs ) if prevent_register != true skip_register << Array . wrap ( prevent_register ) register_pending! end namespaces = xargs [ :namespaces ] namespaces = namespaces . is_a? ( Set ) ? namespaces . to_a : Array . wrap ( namespaces ) namespaces += [ :base ] unless xargs . fetch ( :exclusive , false ) possibilities = Array . wrap ( key_or_name ) possibilities += Array . wrap ( xargs [ :fallback ] ) if xargs . key? ( :fallback ) namespaces . uniq . find do | namespace | possibilities . find do | item | result = dig ( namespace , xargs . fetch ( :base_class , :Type ) , item ) return result . call unless result . nil? end end ensure skip_register . pop end
Find the given key or name inside the base class either on the given
namespace or in the base +:base+ namespace
Find the given key or name inside the base class either on the given namespace or in the base + : base + namespace
key_or_name
prevent_register
xargs