Class: SolidusGraphqlApi::Queries::ProductsQuery
- Inherits:
-
Object
- Object
- SolidusGraphqlApi::Queries::ProductsQuery
- Defined in:
- lib/solidus_graphql_api/queries/products_query.rb
Instance Attribute Summary collapse
-
#pricing_options ⇒ Object
readonly
Returns the value of attribute pricing_options.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #call(query: {}) ⇒ Object
-
#initialize(user:, pricing_options:) ⇒ ProductsQuery
constructor
A new instance of ProductsQuery.
Constructor Details
#initialize(user:, pricing_options:) ⇒ ProductsQuery
Returns a new instance of ProductsQuery.
8 9 10 11 |
# File 'lib/solidus_graphql_api/queries/products_query.rb', line 8 def initialize(user:, pricing_options:) @user = user @pricing_options = end |
Instance Attribute Details
#pricing_options ⇒ Object (readonly)
Returns the value of attribute pricing_options.
6 7 8 |
# File 'lib/solidus_graphql_api/queries/products_query.rb', line 6 def @pricing_options end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
6 7 8 |
# File 'lib/solidus_graphql_api/queries/products_query.rb', line 6 def user @user end |
Instance Method Details
#call(query: {}) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/solidus_graphql_api/queries/products_query.rb', line 13 def call(query: {}) Spree::Config.searcher_class.new(build_query(query)).tap do |searcher| searcher.current_user = user searcher. = end.retrieve_products.except(:limit, :offset) end |