Module: GraphQL::SmartSelect::ConnectionsProxy

Defined in:
lib/graphql/smart_select/connections_proxy.rb

Overview

Check field for Connections type Dig through edges -> nodes to db fields

Class Method Summary collapse

Class Method Details

.call(ctx) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/graphql/smart_select/connections_proxy.rb', line 12

def call(ctx)
  return yield unless ctx.field.connection?

  digging('node') do
    digging('edges') do
      yield
    end
  end
end

.digging(node_name) ⇒ Object



22
23
24
# File 'lib/graphql/smart_select/connections_proxy.rb', line 22

def digging(node_name)
  yield[node_name].scoped_children.values.first
end