Class: GraphQLActiveRecordResolvers::AssociationTree

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql_activerecord_resolvers/association_tree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, ctx) ⇒ AssociationTree

Returns a new instance of AssociationTree.



5
6
7
8
# File 'lib/graphql_activerecord_resolvers/association_tree.rb', line 5

def initialize(klass, ctx)
  @klass = klass
  @irep_node = ctx.irep_node
end

Instance Attribute Details

#irep_nodeObject (readonly)

Returns the value of attribute irep_node.



3
4
5
# File 'lib/graphql_activerecord_resolvers/association_tree.rb', line 3

def irep_node
  @irep_node
end

#klassObject (readonly)

Returns the value of attribute klass.



3
4
5
# File 'lib/graphql_activerecord_resolvers/association_tree.rb', line 3

def klass
  @klass
end

Instance Method Details

#includes_argumentsObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/graphql_activerecord_resolvers/association_tree.rb', line 10

def includes_arguments
  @includes_arguments ||=
    Association.
      new(
        klass: klass,
        irep_node: irep_node,
        root: true,
      ).
      build_includes_arguments
end