Skip to content
New issue

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

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

Already on GitHub? # to your account

GraphCollection.next_page method doesn't accept api_version as parameter #526

Open
ashishKAgg opened this issue Jun 14, 2016 · 2 comments
Open

Comments

@ashishKAgg
Copy link

GraphCollection.next_page method doesn't accept api_version as parameter. Whenever user perform next_page for /album endpoint, then it returns erroneous value for cover_photo field.
Steps to replicate:

  1. Fetch albums for a page which contains more than 50 albums for api_version 2.6. Fetch following album fields: id,cover_photo.
  2. Response will contain cover_photo value in JSON format. Also, Response will contain paging information along with next url.
  3. Call next_page method on response will return next page albums. However, in this response cover_photo JSON would become string rather than JSON.
@arsduo
Copy link
Owner

arsduo commented Feb 17, 2017

Interesting! That's a good catch. I take it there are cases where you might want to use a specific API version for next_page but not to set it for the API as a whole?

@sdsunjay
Copy link

I am also running into this issue with the Facebook API. Since setting the API version, the following code no longer works:

   def add_movies
     @graph = Koala::Facebook::API.new(access_token)
     @movies = @graph.get_object('me?fields=movies', {}, api_version: 'v3.1')
     puts @movies
     loop do
       break if @movies.blank?

       help_add_movies
       puts @movies.class
       @movies = @movies.next_page
     end
   end

I get NoMethodError (undefined method 'next_page' for #<Hash:0x00007ff18b6a57c8>). Is there a work around or do I need to remove the api version?

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants