lib/rails/graphql/request/strategy.rb
def instance_for(klass)
          @objects_pool[klass] ||= begin
            @objects_pool.each_value.find do |value|
              value.is_a?(klass)
            end || begin
              instance = klass.new
              instance = DynamicInstance.new(instance) unless klass < GraphQL::Schema ||
                klass < GraphQL::Type::Object
              instance
            end
          end
        end
# Check if the given class is in the pool, or add a new instance to the
# pool, and then set the instance as the current object
Check if the given class is in the pool, or add a new instance to the
pool, and then set the instance as the current object
Check if the given class is in the pool or add a new instance to the pool and then set the instance as the current object
def instance_for(klass)
          @objects_pool[klass] ||= begin
            @objects_pool.each_value.find do |value|
              value.is_a?(klass)
            end || begin
              instance = klass.new
              instance = DynamicInstance.new(instance) unless klass < GraphQL::Schema ||
                klass < GraphQL::Type::Object
              instance
            end
          end
        end
def instance_for ( klass ) @objects_pool [ klass ] ||= begin @objects_pool . each_value . find do | value | value . is_a? ( klass ) end || begin instance = klass . new instance = DynamicInstance . new ( instance ) unless klass < GraphQL :: Schema || klass < GraphQL :: Type :: Object instance end end end
Check if the given class is in the pool, or add a new instance to the
pool, and then set the instance as the current object
Check if the given class is in the pool or add a new instance to the pool and then set the instance as the current object
klass