Class: Osso::GraphQL::Mutations::UpdateAppConfig

Inherits:
BaseMutation
  • Object
show all
Defined in:
lib/osso/graphql/mutations/update_app_config.rb

Instance Method Summary collapse

Methods inherited from BaseMutation

#account_domain, #admin_ready?, #domain_ready?, #field_errors, #internal_ready?, #provider_domain, #response_data, #response_error

Instance Method Details

#ready?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/osso/graphql/mutations/update_app_config.rb', line 26

def ready?(*)
  admin_ready?
end

#resolve(**args) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/osso/graphql/mutations/update_app_config.rb', line 16

def resolve(**args)
  app_config = Osso::Models::AppConfig.find
  if app_config.update(**args)
    Osso::Analytics.capture(email: context[:email], event: self.class.name.demodulize, properties: args)
    return response_data(app_config: app_config)
  end

  response_error(app_config.errors)
end