Sha256: d40b4ccb0cdf98c1ce18d7ca385a7b290dd9b75a205c7064b097f5738556da41

Contents?: true

Size: 726 Bytes

Versions: 3

Compression:

Stored size: 726 Bytes

Contents

# frozen_string_literal: true

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

        argument :id, ID, required: true

        field :identity_provider, Types::IdentityProvider, null: true
        field :errors, [String], null: false

        def resolve(id:)
          identity_provider = Osso::Models::IdentityProvider.find(id)

          if identity_provider.destroy
            Osso::Analytics.capture(email: context[:email], event: self.class.name.demodulize, properties: { id: id })
            return response_data(identity_provider: nil)
          end

          response_error(identity_provider.errors)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
osso-0.1.2 lib/osso/graphql/mutations/delete_identity_provider.rb
osso-0.1.1 lib/osso/graphql/mutations/delete_identity_provider.rb
osso-0.1.0 lib/osso/graphql/mutations/delete_identity_provider.rb