Sha256: 5d1cc0502de3e795888230e7ef3499c010aa30cec73889676d8ab2b8c1c1f773

Contents?: true

Size: 694 Bytes

Versions: 24

Compression:

Stored size: 694 Bytes

Contents

# frozen_string_literal: true

module Mutations
  class RegisterConfirmedUser < GraphqlDevise::Mutations::Base
    argument :email,                 String, required: true
    argument :name,                  String, required: true
    argument :password,              String, required: true
    argument :password_confirmation, String, required: true

    field :user, Types::UserType, null: true

    def resolve(**attrs)
      user = User.new(attrs.merge(confirmed_at: Time.zone.now))

      if user.save
        { user: user }
      else
        raise_user_error_list(
          'Custom registration failed',
          errors: user.errors.full_messages
        )
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
graphql_devise-1.3.0 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-1.2.0 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-1.1.1 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-1.1.0 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-1.0.1 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-1.0.0 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-0.18.2 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-0.18.1 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-0.18.0 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-0.17.1 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-0.17.0 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-0.16.0 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-0.15.0 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-0.14.3 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-0.14.2 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-0.14.1 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-0.14.0 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-0.13.6 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-0.13.5 spec/dummy/app/graphql/mutations/register_confirmed_user.rb
graphql_devise-0.13.4 spec/dummy/app/graphql/mutations/register_confirmed_user.rb