Class: SolidusGraphqlApi::Queries::Taxon::ChildrenQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/solidus_graphql_api/queries/taxon/children_query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(taxon:) ⇒ ChildrenQuery

Returns a new instance of ChildrenQuery.



9
10
11
# File 'lib/solidus_graphql_api/queries/taxon/children_query.rb', line 9

def initialize(taxon:)
  @taxon = taxon
end

Instance Attribute Details

#taxonObject (readonly)

Returns the value of attribute taxon.



7
8
9
# File 'lib/solidus_graphql_api/queries/taxon/children_query.rb', line 7

def taxon
  @taxon
end

Instance Method Details

#callObject



13
14
15
# File 'lib/solidus_graphql_api/queries/taxon/children_query.rb', line 13

def call
  SolidusGraphqlApi::BatchLoader.for(taxon, :children, scope: Spree::Taxon.order(:id))
end