lib/rails/graphql/type_map.rb
def after_register(name_or_key, base_class: :Type, namespaces: :base, &block)
        item = fetch(name_or_key,
          prevent_register: true,
          base_class: base_class,
          namespaces: namespaces,
        )

        return block.call(item) unless item.nil?

        namespaces = namespaces.is_a?(Set) ? namespaces.to_a : Array.wrap(namespaces)
        position = callbacks[name_or_key].size

        callbacks[name_or_key] << ->(n, b, result) do
          return unless b === base_class && (n === :base || namespaces.include?(n))
          block.call(result)
          position
        end
      end
# Add a callback that will trigger when a type is registered under the
# given set of settings of this method
Add a callback that will trigger when a type is registered under the
given set of settings of this method
Add a callback that will trigger when a type is registered under the given set of settings of this method
def after_register(name_or_key, base_class: :Type, namespaces: :base, &block)
        item = fetch(name_or_key,
          prevent_register: true,
          base_class: base_class,
          namespaces: namespaces,
        )
        return block.call(item) unless item.nil?
        namespaces = namespaces.is_a?(Set) ? namespaces.to_a : Array.wrap(namespaces)
        position = callbacks[name_or_key].size
        callbacks[name_or_key] << ->(n, b, result) do
          return unless b === base_class && (n === :base || namespaces.include?(n))
          block.call(result)
          position
        end
      end
def after_register ( name_or_key , base_class : :Type , namespaces : :base , & block ) item = fetch ( name_or_key , prevent_register : true , base_class : base_class , namespaces : namespaces , ) return block . call ( item ) unless item . nil? namespaces = namespaces . is_a? ( Set ) ? namespaces . to_a : Array . wrap ( namespaces ) position = callbacks [ name_or_key ] . size callbacks [ name_or_key ] << -> ( n , b , result ) do return unless b === base_class && ( n === :base || namespaces . include? ( n ) ) block . call ( result ) position end end
Add a callback that will trigger when a type is registered under the
given set of settings of this method
Add a callback that will trigger when a type is registered under the given set of settings of this method
name_or_key
base_class
namespaces
block