Class: Osso::GraphQL::Mutations::DeleteEnterpriseAccount

Inherits:
BaseMutation
  • Object
show all
Defined in:
lib/osso/graphql/mutations/delete_enterprise_account.rb

Instance Method Summary collapse

Methods inherited from BaseMutation

#account_domain, #admin_ready?, #domain_ready?, #field_errors, #internal_ready?, #provider_domain, #ready?, #response_data, #response_error

Instance Method Details

#domain(**args) ⇒ Object



26
27
28
# File 'lib/osso/graphql/mutations/delete_enterprise_account.rb', line 26

def domain(**args)
  (**args).domain
end

#enterprise_account(id:, **_args) ⇒ Object



14
15
16
# File 'lib/osso/graphql/mutations/delete_enterprise_account.rb', line 14

def (id:, **_args)
  @enterprise_account ||= Osso::Models::EnterpriseAccount.find(id)
end

#resolve(**args) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/osso/graphql/mutations/delete_enterprise_account.rb', line 18

def resolve(**args)
  customer = (**args)

  return response_data(enterprise_account: nil) if customer.destroy

  response_error(customer.errors)
end