Sha256: 46832324c3d17e8cc2f23011009440358e8ecb43b68ad216301e6aad64c53c5b
Contents?: true
Size: 1.11 KB
Versions: 13
Compression:
Stored size: 1.11 KB
Contents
# frozen_string_literal: true module Osso module GraphQL module Mutations class CreateIdentityProvider < BaseMutation null false argument :enterprise_account_id, ID, required: true argument :service, Types::IdentityProviderService, required: false field :identity_provider, Types::IdentityProvider, null: false field :errors, [String], null: false def resolve(service: nil, **args) customer = enterprise_account(**args) identity_provider = customer.identity_providers.build( service: service, domain: customer.domain, oauth_client_id: customer.oauth_client_id, ) return response_data(identity_provider: identity_provider) if identity_provider.save response_error(identity_provider.errors) end def domain(**args) enterprise_account(**args)&.domain end def enterprise_account(enterprise_account_id:, **_args) @enterprise_account ||= Osso::Models::EnterpriseAccount.find(enterprise_account_id) end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems