Sha256: 2b06122d724265227fa27624908db6452fcc2720fd6baa274bdc13366b3732fd

Contents?: true

Size: 683 Bytes

Versions: 10

Compression:

Stored size: 683 Bytes

Contents

# frozen_string_literal: true

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

        argument :domain, String, required: true
        argument :name, String, required: true

        field :enterprise_account, Types::EnterpriseAccount, null: false
        field :errors, [String], null: false

        def resolve(**args)
          enterprise_account = Osso::Models::EnterpriseAccount.new(args)

          return response_data(enterprise_account: enterprise_account) if enterprise_account.save

          response_error(errors: enterprise_account.errors.full_messages)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
osso-0.0.3.16 lib/osso/graphql/mutations/create_enterprise_account.rb
osso-0.0.3.15 lib/osso/graphql/mutations/create_enterprise_account.rb
osso-0.0.3.14 lib/osso/graphql/mutations/create_enterprise_account.rb
osso-0.0.3.13 lib/osso/graphql/mutations/create_enterprise_account.rb
osso-0.0.3.12 lib/osso/graphql/mutations/create_enterprise_account.rb
osso-0.0.3.11 lib/osso/graphql/mutations/create_enterprise_account.rb
osso-0.0.3.9 lib/osso/graphql/mutations/create_enterprise_account.rb
osso-0.0.3.8 lib/osso/graphql/mutations/create_enterprise_account.rb
osso-0.0.3.7 lib/osso/graphql/mutations/create_enterprise_account.rb
osso-0.0.3.6 lib/osso/graphql/mutations/create_enterprise_account.rb