DEV Community

RJ-1998
RJ-1998

Posted on

Login/Logout functionality with Reactjs and Graphql

I'm trying to build a login/logout functionality using Graphql and Reactjs.
Here's my schema file


I want to create a login mutation inside which I want to check if the user with certain email-id exist or not and if exists then password matches or not. This logic should be inside the resolve method but I am unable to figure out how to do it.
Here's my Login React Component

I also want to keep track of the token so that the user remains logged in if he or she refresh the page.
If someone has the solution please let me know πŸ™

Top comments (0)