Module: GraphQL::Relay::Define::AssignConnection

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

Class Method Summary collapse

Class Method Details

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



5
6
7
8
9
# File 'lib/graphql/relay/define.rb', line 5

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[name.to_s] = connection_field
end