Class: GraphQLActiveRecordResolvers::Association
- Inherits:
-
Object
- Object
- GraphQLActiveRecordResolvers::Association
- Defined in:
- lib/graphql_activerecord_resolvers/association.rb
Instance Attribute Summary collapse
-
#irep_node ⇒ Object
readonly
Returns the value of attribute irep_node.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #build_includes_arguments ⇒ Object
-
#initialize(klass:, irep_node:, root:) ⇒ Association
constructor
A new instance of Association.
Constructor Details
#initialize(klass:, irep_node:, root:) ⇒ Association
Returns a new instance of Association.
5 6 7 8 9 |
# File 'lib/graphql_activerecord_resolvers/association.rb', line 5 def initialize(klass:, irep_node:, root:) @klass = klass @irep_node = irep_node @root = root end |
Instance Attribute Details
#irep_node ⇒ Object (readonly)
Returns the value of attribute irep_node.
3 4 5 |
# File 'lib/graphql_activerecord_resolvers/association.rb', line 3 def irep_node @irep_node end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
3 4 5 |
# File 'lib/graphql_activerecord_resolvers/association.rb', line 3 def klass @klass end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
3 4 5 |
# File 'lib/graphql_activerecord_resolvers/association.rb', line 3 def root @root end |
Instance Method Details
#build_includes_arguments ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/graphql_activerecord_resolvers/association.rb', line 11 def build_includes_arguments if root child_associations.map(&:build_includes_arguments) elsif child_associations.any? { irep_node_association_name => child_associations.map(&:build_includes_arguments), } else irep_node_association_name end end |