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



29
30
31
# File 'lib/osso/graphql/mutations/delete_enterprise_account.rb', line 29

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)
   ||= Osso::Models::EnterpriseAccount.find(id)
end

#resolve(**args) ⇒ Object



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

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

  if customer.destroy
    Osso::Analytics.capture(email: context[:email], event: self.class.name.demodulize, properties: args)
    return response_data(enterprise_account: nil)
  end

  response_error(customer.errors)
end