Skip to content

Missing stats & meta from remote resources #495

@eslamodeh

Description

@eslamodeh

Hello everyone,

I was wondering whether we have to update the resolve function to parse the meta & stats? At the moment, this is not accessible:

irb(main):020:0> resource_klass.adapter
=> Graphiti::Adapters::GraphitiAPI
irb(main):021:0> resource_klass.all(stats: { total: 'count' }).meta
=> {}
irb(main):022:0> resource_klass.all(stats: { total: 'count' }).stats
=> {:total=>{:count=>nil}}

def resolve(scope)
url = build_url(scope)
response = resource.make_request(url)
json = JSON.parse(response.body)
if json["errors"]
handle_remote_error(url, json)
else
models = json["data"].map { |d| build_entity(json, d) }
Util::RemoteSerializer.for(resource.class.serializer, models)
models
end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions