Class: Mutations::Auth::ValidateToken

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

Overview

mutation {

validateToken {
  success
  valid
  user {
    email
  }
}

}

Instance Method Summary collapse

Instance Method Details

#resolveObject



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

def resolve
  user = context[:current_user]

  {
    errors: [],
    success: user.present?,
    user: user,
    valid: user.present?,
  }
end