lib/rails/graphql/request/helpers/value_writers.rb
# Resolve a given value when it is an array
Resolve a given value when it is an array
Resolve a given value when it is an array
def write_array(value, idx = -1, &block)
          write_array!(value) do |item|
            stacked(idx += 1) do
              block.call(item, idx)
              response.next
            rescue StandardError => error
              raise if item.nil?
              block.call(nil, idx)
              response.next
              format_array_execption(error, idx)
              request.exception_to_error(error, @node)
            end
          rescue StandardError => error
            format_array_execption(error, idx)
            raise
          end
        end
def write_array ( value , idx = - 1 , & block ) write_array! ( value ) do | item | stacked ( idx += 1 ) do block . call ( item , idx ) response . next rescue StandardError => error raise if item . nil? block . call ( nil , idx ) response . next format_array_execption ( error , idx ) request . exception_to_error ( error , @node ) end rescue StandardError => error format_array_execption ( error , idx ) raise end end
Resolve a given value when it is an array
Resolve a given value when it is an array
value
idx
block