Class: SolidusGraphqlApi::Queries::CompletedOrdersQuery

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user:) ⇒ CompletedOrdersQuery

Returns a new instance of CompletedOrdersQuery.



8
9
10
# File 'lib/solidus_graphql_api/queries/completed_orders_query.rb', line 8

def initialize(user:)
  @user = user
end

Instance Attribute Details

#userObject (readonly)

Returns the value of attribute user.



6
7
8
# File 'lib/solidus_graphql_api/queries/completed_orders_query.rb', line 6

def user
  @user
end

Instance Method Details

#callObject



12
13
14
15
16
# File 'lib/solidus_graphql_api/queries/completed_orders_query.rb', line 12

def call
  return [] unless user

  user.orders.complete.order :id
end