lib/rails/graphql/source/scoped_arguments.rb
# Find all the executable arguments attached to the running field and
# call them with the given object
Find all the executable arguments attached to the running field and
call them with the given object
Find all the executable arguments attached to the running field and call them with the given object
def inject_scopes(object, assigned_to = nil)
        return object if event.field.nil? || (args_source = event.send(:args_source)).nil?
        event.data[assigned_to] ||= object unless assigned_to.nil?
        event.field.all_arguments.each_value.inject(object) do |result, argument|
          arg_value = args_source.key?(argument.name) \
            ? args_source[argument.name] \
            : argument.default
          next result if arg_value.nil? || !argument.respond_to?(:block)
          send_args = argument.block.arity.eql?(1) ? [arg_value] : []
          value = result.instance_exec(*send_args, &argument.block)
          value = value.nil? ? result : value
          assigned_to.nil? ? value : event.data[assigned_to] = value
        end
      end
def inject_scopes ( object , assigned_to = nil ) return object if event . field . nil? || ( args_source = event . send ( :args_source ) ) . nil? event . data [ assigned_to ] ||= object unless assigned_to . nil? event . field . all_arguments . each_value . inject ( object ) do | result , argument | arg_value = args_source . key? ( argument . name ) ? args_source [ argument . name ] : argument . default next result if arg_value . nil? || ! argument . respond_to? ( :block ) send_args = argument . block . arity . eql? ( 1 ) ? [ arg_value ] : [ ] value = result . instance_exec ( * send_args , & argument . block ) value = value . nil? ? result : value assigned_to . nil? ? value : event . data [ assigned_to ] = value end end
Find all the executable arguments attached to the running field and
call them with the given object
Find all the executable arguments attached to the running field and call them with the given object
object
assigned_to