Sha256: 38a2056954e4e62496071045c57fe9b0538533751e76e0e57163763bbb2f5e5c

Contents?: true

Size: 661 Bytes

Versions: 6

Compression:

Stored size: 661 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(enterprise_account.errors)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
osso-0.0.10 lib/osso/graphql/mutations/create_enterprise_account.rb
osso-0.0.8 lib/osso/graphql/mutations/create_enterprise_account.rb
osso-0.0.7 lib/osso/graphql/mutations/create_enterprise_account.rb
osso-0.0.6 lib/osso/graphql/mutations/create_enterprise_account.rb
osso-0.0.6.alpha lib/osso/graphql/mutations/create_enterprise_account.rb
osso-0.0.5 lib/osso/graphql/mutations/create_enterprise_account.rb