Skip to content

Missing stats & meta from remote resources #495

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified to reproduce; see needs-repro for unconfirmed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions