Class: SolidusGraphqlApi::Mutations::Checkout::NextCheckoutState

Inherits:
BaseMutation
  • Object
show all
Defined in:
lib/solidus_graphql_api/mutations/checkout/next_checkout_state.rb

Instance Method Summary collapse

Instance Method Details

#ready?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/solidus_graphql_api/mutations/checkout/next_checkout_state.rb', line 21

def ready?(*)
  current_ability.authorize!(:update, current_order, guest_token)
end

#resolveObject



12
13
14
15
16
17
18
19
# File 'lib/solidus_graphql_api/mutations/checkout/next_checkout_state.rb', line 12

def resolve
  current_order.next

  {
    order: current_order.reload,
    errors: user_errors("order", current_order.errors)
  }
end