lib/rails/graphql/request/helpers/value_writers.rb
# Helper to start writing as array
Helper to start writing as array
Helper to start writing as array
def write_array!(value, &block)
          raise InvalidValueError, <<~MSG.squish unless value.respond_to?(:each)
            The #{gql_name} field is excepting an array
            but got an "#{value.class.name}" instead.
          MSG
          @writing_array = true
          response.with_stack(gql_name, array: true, plain: leaf_type?) do
            value.each(&block)
          end
        ensure
          @writing_array = nil
        end
def write_array! ( value , & block ) raise InvalidValueError , <<~MSG . squish unless value . respond_to? ( :each ) 
            The  #{ gql_name }  field is excepting an array
            but got an " #{ value . class . name } " instead.
           MSG @writing_array = true response . with_stack ( gql_name , array : true , plain : leaf_type? ) do value . each ( & block ) end ensure @writing_array = nil end
Helper to start writing as array
Helper to start writing as array
value
block