Module: GraphQL::Define::AssignConnection

Defined in:
lib/graphql/define/assign_connection.rb

Class Method Summary collapse

Class Method Details

.call(type_defn, *field_args, max_page_size: nil, **field_kwargs, &field_block) ⇒ Object



4
5
6
7
8
# File 'lib/graphql/define/assign_connection.rb', line 4

def self.call(type_defn, *field_args, max_page_size: nil, **field_kwargs, &field_block)
  underlying_field = GraphQL::Define::AssignObjectField.call(type_defn, *field_args, **field_kwargs, &field_block)
  connection_field = GraphQL::Relay::ConnectionField.create(underlying_field, max_page_size: max_page_size)
  type_defn.fields[underlying_field.name] = connection_field
end