Sha256: 0fbffff870ddb221d51b40ed0d5bbb913c7fbcef1f1ed76a258a91bed0f0df52

Contents?: true

Size: 1011 Bytes

Versions: 19

Compression:

Stored size: 1011 Bytes

Contents

module GraphqlDevise
  module MailerHelper
    def confirmation_query(resource_name:, token:, redirect_url:)
      name = "#{resource_name.camelize(:lower)}ConfirmAccount"
      raw = <<-GRAPHQL
        query($token:String!,$redirectUrl:String!){
          #{name}(confirmationToken:$token,redirectUrl:$redirectUrl){
            email
          }
        }
      GRAPHQL

      {
        query:     raw.delete("\n").delete(' ').html_safe,
        variables: { token: token, redirectUrl: redirect_url }
      }
    end

    def password_reset_query(token:, redirect_url:, resource_name:)
      name = "#{resource_name.camelize(:lower)}CheckPasswordToken"
      raw = <<-GRAPHQL
        query($token:String!,$redirectUrl:String!){
          #{name}(resetPasswordToken:$token,redirectUrl:$redirectUrl){
            email
          }
        }
      GRAPHQL

      {
        query:     raw.delete("\n").delete(' ').html_safe,
        variables: { token: token, redirectUrl: redirect_url }
      }
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
graphql_devise-0.11.4 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.11.3 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.11.2 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.11.1 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.11.0 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.10.1 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.10.0 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.9.2 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.9.1 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.9.0 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.8.1 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.8.0 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.7.0 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.6.0 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.5.0 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.4.1 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.4.0 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.3.0 app/helpers/graphql_devise/mailer_helper.rb
graphql_devise-0.2.0 app/helpers/graphql_devise/mailer_helper.rb