module GraphQL::Types::Relay::ConnectionBehaviors
Public Class Methods
# File lib/graphql/types/relay/connection_behaviors.rb, line 207 def add_page_info_field(obj_type) obj_type.field :page_info, GraphQL::Types::Relay::PageInfo, null: false, description: "Information to aid in pagination." end
Source
# File lib/graphql/types/relay/connection_behaviors.rb, line 13 def self.included(child_class) child_class.extend(ClassMethods) child_class.has_nodes_field(true) child_class.node_nullable(true) child_class.edges_nullable(true) child_class.edge_nullable(true) child_class.module_exec { #: self as GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods self.edge_type = nil self.node_type = nil self.edge_class = nil } child_class.default_broadcastable(nil) add_page_info_field(child_class) end
Public Instance Methods
Source
# File lib/graphql/types/relay/connection_behaviors.rb, line 212 def edges # Assume that whatever authorization needed to happen # already happened at the connection level. if (current_runtime_state = Fiber[:__graphql_runtime_info]) query_runtime_state = current_runtime_state[context.query] query_runtime_state.was_authorized_by_scope_items = @object.was_authorized_by_scope_items? end @object.edges end
Source
# File lib/graphql/types/relay/connection_behaviors.rb, line 222 def nodes # Assume that whatever authorization needed to happen # already happened at the connection level. if (current_runtime_state = Fiber[:__graphql_runtime_info]) query_runtime_state = current_runtime_state[context.query] query_runtime_state.was_authorized_by_scope_items = @object.was_authorized_by_scope_items? end @object.nodes end