lib/osso/graphql/mutations/create_identity_provider.rb in osso-0.0.11 vs lib/osso/graphql/mutations/create_identity_provider.rb in osso-0.1.0

- old
+ new

@@ -11,11 +11,11 @@ argument :oauth_client_id, String, required: true field :identity_provider, Types::IdentityProvider, null: false field :errors, [String], null: false - def resolve(service: nil, enterprise_account_id:, oauth_client_id:) + def resolve(enterprise_account_id:, oauth_client_id:, service: nil) customer = enterprise_account(enterprise_account_id: enterprise_account_id) identity_provider = customer.identity_providers.build( service: service, domain: customer.domain, @@ -25,15 +25,15 @@ if identity_provider.save Osso::Analytics.capture(email: context[:email], event: self.class.name.demodulize, properties: { service: service, enterprise_account_id: enterprise_account_id, oauth_client_id: oauth_client_id }) return response_data(identity_provider: identity_provider) - end + end response_error(identity_provider.errors) end - def domain(enterprise_account_id:, **args) + def domain(enterprise_account_id:, **_args) enterprise_account(enterprise_account_id: enterprise_account_id)&.domain end def enterprise_account(enterprise_account_id:) @enterprise_account ||= Osso::Models::EnterpriseAccount.find(enterprise_account_id)