Class: Mutations::Auth::ForgotPassword

Inherits:
GraphQL::Schema::Mutation
  • Object
show all
Defined in:
app/graphql/mutations/auth/forgot_password.rb

Overview

mutation {

forgotPassword(email: "[email protected]") {
   valid
   success
 }

}

Instance Method Summary collapse

Instance Method Details

#resolve(email:) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'app/graphql/mutations/auth/forgot_password.rb', line 18

def resolve(email:)
  user = User.find_by email: email
  user.send_reset_password_instructions if user.present?

  {
    errors: [],
    success: true,
    valid: true
  }
end