Class: Mirah::Filters::Paging

Inherits:
BaseObject show all
Defined in:
lib/mirah/filters/paging.rb

Overview

A set of input parameters designed to let you select how many and which records you want from a pagination cursor. It is based on Graphql's Relay specification. This can be used with Data::PageInfo, which will be provided by the results of a server query, to provide stable pagination framework.

Instance Attribute Summary collapse

Class 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

#afterstring (readonly)

Return rows after the given cursor position

Returns:

  • (string)

    Return rows after the given cursor position


26
# File 'lib/mirah/filters/paging.rb', line 26

attribute :after

#beforestring (readonly)

Return rows before the given cursor position

Returns:

  • (string)

    Return rows before the given cursor position


22
# File 'lib/mirah/filters/paging.rb', line 22

attribute :before

#firststring (readonly)

Return the first N rows from either the start, or the current cursor position. Cannot be used at the same time as #last

Returns:

  • (string)

    Return the first N rows from either the start, or the current cursor position. Cannot be used at the same time as #last


13
# File 'lib/mirah/filters/paging.rb', line 13

attribute :first

#laststring (readonly)

Return the last N rows from either the end, or the current cursor position. Cannot be used at the same time as #first

Returns:

  • (string)

    Return the last N rows from either the end, or the current cursor position. Cannot be used at the same time as #first


18
# File 'lib/mirah/filters/paging.rb', line 18

attribute :last

Class Method Details

.defaultObject


28
29
30
# File 'lib/mirah/filters/paging.rb', line 28

def self.default
  new(first: 100)
end