Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eager loading nested resources (field expansion) #145

Open
adambedford opened this issue Jun 11, 2021 · 2 comments
Open

Eager loading nested resources (field expansion) #145

adambedford opened this issue Jun 11, 2021 · 2 comments

Comments

@adambedford
Copy link

Which SDK version are you using?

0.10.0.0

What's the issue?

I'm using field expansion to eager load some nested resources.

e.g. account.campaigns(fields: "name,adsets{name},ads{name,creative{image_url}}")

However, when I access those resources after they have been instantiated in Ruby, I'm pretty sure API requests are taking place even though the data has already been fetched. Is the Ruby library supposed to support this type of eager loading?

The solution I have currently is to dig into the raw attributes["data"] and fetch the data I need from that hash. The downside is I'm no longer dealing with domain-specific Ruby objects and can't easily fetch additional edges etc.

Any guidance would be greatly appreciated!

@stale
Copy link

stale bot commented Jan 8, 2022

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Jan 8, 2022
@dredenba
Copy link

I still see this and would like a better solution

@stale stale bot removed the Stale label Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants