lib/rails/graphql/request/helpers/selection_set.rb
# Using +fields_source+, find the needed ones to be assigned to the
# current requested fields. As shown by benchmark, since the index is
# based on Symbols, the best way to find +gql_name+ based fields is
# through interation and search. Complexity O(n)
Using +fields_source+, find the needed ones to be assigned to the
current requested fields. As shown by benchmark, since the index is
based on Symbols, the best way to find +gql_name+ based fields is
through interation and search.
Using + fields_source + find the needed ones to be assigned to the current requested fields . As shown by benchmark since the index is based on Symbols the best way to find + gql_name + based fields is through interation and search .
def assing_fields!(assigners)
            pending = assigners.map(&:size).reduce(:+) || 0
            return if pending.zero?
            fields_source.each_value do |field|
              next unless assigners.key?(field.gql_name)
              items = assigners[field.gql_name]
              items.each_with_object(field).each(&:assing_to)
              break if (pending -= items.size) === 0
            end
          end
def assing_fields! ( assigners ) pending = assigners . map ( & :size ) . reduce ( :+ ) || 0 return if pending . zero? fields_source . each_value do | field | next unless assigners . key? ( field . gql_name ) items = assigners [ field . gql_name ] items . each_with_object ( field ) . each ( & :assing_to ) break if ( pending -= items . size ) === 0 end end
Using +fields_source+, find the needed ones to be assigned to the
current requested fields.
Using + fields_source + find the needed ones to be assigned to the current requested fields .
assigners