Sha256: 58d3d3552c289922f6fe8edb9883bfcf5bbfeff543aba15202411e631cfbb7db

Contents?: true

Size: 965 Bytes

Versions: 10

Compression:

Stored size: 965 Bytes

Contents

# frozen_string_literal: true

module Osso
  module GraphQL
    module Mutations
      class ConfigureIdentityProvider < BaseMutation
        null false
        argument :id, ID, required: true
        argument :service, Types::IdentityProviderService, required: false
        argument :sso_url, String, required: false
        argument :sso_cert, String, required: false

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

        def resolve(**args)
          provider = identity_provider(**args)

          return response_data(identity_provider: provider) if provider.update(args)

          response_error(errors: provider.errors.messages)
        end

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

        def identity_provider(id:, **_args)
          @identity_provider ||= Osso::Models::IdentityProvider.find(id)
        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/configure_identity_provider.rb
osso-0.0.3.25 lib/osso/graphql/mutations/configure_identity_provider.rb
osso-0.0.3.24 lib/osso/graphql/mutations/configure_identity_provider.rb
osso-0.0.3.23 lib/osso/graphql/mutations/configure_identity_provider.rb
osso-0.0.3.22 lib/osso/graphql/mutations/configure_identity_provider.rb
osso-0.0.3.21 lib/osso/graphql/mutations/configure_identity_provider.rb
osso-0.0.3.20 lib/osso/graphql/mutations/configure_identity_provider.rb
osso-0.0.3.19 lib/osso/graphql/mutations/configure_identity_provider.rb
osso-0.0.3.18 lib/osso/graphql/mutations/configure_identity_provider.rb
osso-0.0.3.17 lib/osso/graphql/mutations/configure_identity_provider.rb