Sha256: 4d2ea86c383bb832525b6d90213e8f29532d416c9670a71de53a7663f47e40ce

Contents?: true

Size: 787 Bytes

Versions: 10

Compression:

Stored size: 787 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(errors: customer.errors.full_messages)
        end

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
osso-0.0.3.26 lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.3.25 lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.3.24 lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.3.23 lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.3.22 lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.3.21 lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.3.20 lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.3.19 lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.3.18 lib/osso/graphql/mutations/delete_enterprise_account.rb
osso-0.0.3.17 lib/osso/graphql/mutations/delete_enterprise_account.rb