Class: GraphQL::Relay::ArrayConnection

Inherits:
BaseConnection show all
Defined in:
lib/graphql/relay/array_connection.rb

Constant Summary

Constants inherited from BaseConnection

BaseConnection::CONNECTION_IMPLEMENTATIONS, BaseConnection::CURSOR_SEPARATOR, BaseConnection::METHODS_FROM_ARGUMENTS

Instance Attribute Summary

Attributes inherited from BaseConnection

#arguments, #max_page_size, #object, #parent

Instance Method Summary collapse

Methods inherited from BaseConnection

#after, #before, connection_for_items, #edge_nodes, #end_cursor, #first, #has_next_page, #has_previous_page, #initialize, #last, #order, #page_info, register_connection_implementation, #start_cursor

Constructor Details

This class inherits a constructor from GraphQL::Relay::BaseConnection

Instance Method Details

#cursor_from_node(item) ⇒ Object



4
5
6
7
# File 'lib/graphql/relay/array_connection.rb', line 4

def cursor_from_node(item)
  idx = starting_offset + sliced_nodes.find_index(item) + 1
  Base64.strict_encode64(idx.to_s)
end