facebook / facebook-ruby-business-sdk

Ruby SDK for Meta Marketing API
https://developers.facebook.com/docs/business-sdk
Other
204 stars 161 forks source link

Eager loading nested resources (field expansion) #145

Open adambedford opened 3 years ago

adambedford commented 3 years ago

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[bot] commented 2 years ago

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.

dredenba commented 2 years ago

I still see this and would like a better solution