Method: Rails::GraphQL::Request::PreparedData#next

Defined in:
lib/rails/graphql/request/prepared_data.rb

#nextObject

Get the next value, take into consideration the value on repeat



86
87
88
89
90
91
92
93
94
95
96
# File 'lib/rails/graphql/request/prepared_data.rb', line 86

def next
  value = enum.next
  @field.array? ? Array.wrap(value) : value
rescue StopIteration
  if @repeat == true || (@repeat != false && (@repeat -= 1) > 0)
    enum.rewind
    self.next
  else
    NULL
  end
end