Class: GQL::Connection

Inherits:
Field
  • Object
show all
Defined in:
lib/gql/connection.rb

Instance Attribute Summary

Attributes inherited from Field

#ast_node, #context, #target, #variables

Class Method Summary collapse

Methods inherited from Field

execute, #initialize, #scalar_value, #value

Methods included from Mixins::Common

#propagate, #shutdown

Constructor Details

This class inherits a constructor from GQL::Field

Class Method Details

.build_class(id, proc, options = {}) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/gql/connection.rb', line 4

def build_class(id, proc, options = {})
  list_class = options.delete(:list_class) || GQL.default_list_class
  item_class = options.delete(:item_class)

  Registry.fetch(list_class).build_class(id, proc, options).tap do |field_class|
    field_class.array :edges, -> { target }, item_class: item_class
  end
end