module GraphQL::Relay::ConnectionType

@api deprecated

Attributes

bidirectional_pagination[R]
default_nodes_field[R]

Public Class Methods

bidirectional_pagination=(new_setting) click to toggle source

@return [Boolean] If true, connections check for reverse-direction `has*Page` values

# File lib/graphql/relay/connection_type.rb, line 17
def bidirectional_pagination=(new_setting)
  if new_setting
    warn("GraphQL::Relay::ConnectionType will be removed in GraphQL 2.0.0; migrate to `GraphQL::Pagination::Connections` and remove this setting (`bidirectional_pagination = true`).")
  end
  @bidirectional_pagination = new_setting
end
create_type(wrapped_type, edge_type: nil, edge_class: GraphQL::Relay::Edge, nodes_field: ConnectionType.default_nodes_field, &block) click to toggle source

@api deprecated

# File lib/graphql/relay/connection_type.rb, line 30
def self.create_type(wrapped_type, edge_type: nil, edge_class: GraphQL::Relay::Edge, nodes_field: ConnectionType.default_nodes_field, &block)
  custom_edge_class = edge_class

  # Any call that would trigger `wrapped_type.ensure_defined`
  # must be inside this lazy block, otherwise we get weird
  # cyclical dependency errors :S
  ObjectType.deprecated_define do
    type_name = wrapped_type.is_a?(GraphQL::BaseType) ? wrapped_type.name : wrapped_type.graphql_name
    edge_type ||= wrapped_type.edge_type
    name("#{type_name}Connection")
    description("The connection type for #{type_name}.")
    field :edges, types[edge_type], "A list of edges.", edge_class: custom_edge_class, property: :edge_nodes

    if nodes_field
      field :nodes, types[wrapped_type],  "A list of nodes.", property: :edge_nodes
    end

    field :pageInfo, !PageInfo, "Information to aid in pagination.", property: :page_info
    relay_node_type(wrapped_type)
    block && instance_eval(&block)
  end
end
default_nodes_field=(new_setting) click to toggle source

@return [Boolean] If true, connection types get a `nodes` shortcut field

# File lib/graphql/relay/connection_type.rb, line 8
def default_nodes_field=(new_setting)
  if new_setting
    warn("GraphQL::Relay::ConnectionType will be removed in GraphQL 2.0.0; migrate to `GraphQL::Pagination::Connections` and remove this setting (`default_nodes_field = true`).")
  end
  @default_nodes_field = new_setting
end