Sha256: f63e79061ef647eaee5f5596219477195a733271a2fcf01ff076a613e38f3057

Contents?: true

Size: 765 Bytes

Versions: 19

Compression:

Stored size: 765 Bytes

Contents

# frozen_string_literal: true

module Osso
  module GraphQL
    module Mutations
      class DeleteEnterpriseAccount < BaseMutation
        null false

        argument :id, ID, required: true

        field :enterprise_account, Types::EnterpriseAccount, null: true
        field :errors, [String], null: false

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

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

          return response_data(enterprise_account: nil) if customer.destroy

          response_error(customer.errors)
        end

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

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
osso-0.0.10 lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.8 lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.7 lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.6 lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.6.alpha lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.5 lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.5.pre.lambda lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.5.pre.kappa lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.5.pre.iota lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.5.pre.theta lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.5.pre.eta lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.5.pre.zeta lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.5.pre.epsilon lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.5.pre.delta lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.5.pre.gamma lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.5.pre.beta lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.5.pre.alpha lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.4 lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.3.27 lib/osso/graphql/mutations/delete_enterprise_account.rb