Method: Graphiti::ResourceProxy#data

Defined in:
lib/graphiti/resource_proxy.rb

#dataObject Also known as: to_a



66
67
68
69
70
71
72
73
74
75
# File 'lib/graphiti/resource_proxy.rb', line 66

def data
  @data ||= begin
    records = @scope.resolve
    if records.empty? && raise_on_missing?
      raise Graphiti::Errors::RecordNotFound
    end
    records = records[0] if single?
    records
  end
end