Class: SolidusGraphqlApi::Types::Query

Inherits:
Base::Object
  • Object
show all
Defined in:
lib/solidus_graphql_api/types/query.rb

Instance Method Summary collapse

Methods inherited from Base::Object

remove_field

Instance Method Details

#completed_ordersObject



52
53
54
# File 'lib/solidus_graphql_api/types/query.rb', line 52

def completed_orders
  Queries::CompletedOrdersQuery.new(user: context[:current_user]).call
end

#countriesObject



48
49
50
# File 'lib/solidus_graphql_api/types/query.rb', line 48

def countries
  Queries::CountriesQuery.new.call
end

#current_orderObject



79
80
81
# File 'lib/solidus_graphql_api/types/query.rb', line 79

def current_order
  context[:current_order]
end

#current_storeObject



75
76
77
# File 'lib/solidus_graphql_api/types/query.rb', line 75

def current_store
  context[:current_store]
end

#current_userObject



71
72
73
# File 'lib/solidus_graphql_api/types/query.rb', line 71

def current_user
  context[:current_user]
end

#product_by_slug(slug:) ⇒ Object



63
64
65
# File 'lib/solidus_graphql_api/types/query.rb', line 63

def product_by_slug(slug:)
  Queries::ProductBySlugQuery.new.call(slug: slug)
end

#products(query: {}) ⇒ Object



56
57
58
59
60
61
# File 'lib/solidus_graphql_api/types/query.rb', line 56

def products(query: {})
  Queries::ProductsQuery.new(
    user: context[:current_user],
    pricing_options: context[:current_pricing_options]
  ).call(query: query)
end

#taxonomiesObject



67
68
69
# File 'lib/solidus_graphql_api/types/query.rb', line 67

def taxonomies
  Queries::TaxonomiesQuery.new.call
end