Class: Mirah::Data::PageInfo

Inherits:
BaseObject show all
Defined in:
lib/mirah/data/page_info.rb

Overview

PageInfo gives information on the current state of paging as returned by the server. This includes information about the start and the end cursors of the result set, and whether or not there are additiona pages. This can be used in combination with Filters::Paging to make a stable cursor-based pagination call.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseObject

from_graphql_hash, #initialize, #to_graphql_hash

Constructor Details

This class inherits a constructor from Mirah::BaseObject

Instance Attribute Details

#end_cursorstring (readonly)

Returns The cursor of the last record of the current set. This can be used as a starting point for the next page of the query.

Returns:

  • (string)

    The cursor of the last record of the current set. This can be used as a starting point for the next page of the query.



12
# File 'lib/mirah/data/page_info.rb', line 12

attribute :end_cursor

#has_next_pageBoolean (readonly)

Returns Whether the data set has a next page.

Returns:

  • (Boolean)

    Whether the data set has a next page



21
# File 'lib/mirah/data/page_info.rb', line 21

attribute :has_next_page

#has_previous_pageBoolean (readonly)

Returns Whether the data set has a next page.

Returns:

  • (Boolean)

    Whether the data set has a next page



25
# File 'lib/mirah/data/page_info.rb', line 25

attribute :has_previous_page

#start_cursorstring (readonly)

Returns The cursor of the first record of the current set. This can be used to get the previous page.

Returns:

  • (string)

    The cursor of the first record of the current set. This can be used to get the previous page.



17
# File 'lib/mirah/data/page_info.rb', line 17

attribute :start_cursor

Instance Method Details

#next_page?Boolean

Returns:

  • (Boolean)

See Also:



29
30
31
# File 'lib/mirah/data/page_info.rb', line 29

def next_page?
  has_next_page
end

#prev_page?Boolean

Returns:

  • (Boolean)

See Also:



35
36
37
# File 'lib/mirah/data/page_info.rb', line 35

def prev_page?
  has_previous_page
end