Before going back to this post, I was out of adding my content to Medium. The reason is it quite painful to manually add my code as Github Gists and come back and paste it here. Because my personal blog site and dev.to …
This blog post originally posted on my blog site and you can find it here.
As I said in an earlier post we have to manage 2 scenarios here.
1. Refresh the cache for forgot password
2. Error handle for token errors.
Add below code lines to handle the token…
From the last post, we stop at finishing
forgotPassword mutation. Now we come to
GraphQL playground and execute the forget-password mutation.
Then in the
console you will see the forget password URL and click it. It will show the test email. Click on the link and it will navigate…
Now we are adding email functions to the server. For this, we use
NodeMailer . Use the below command to add it.
yarn add nodemailer
yarn add -D @types/nodemailer // this is for TS support
We can grab the code from there example and paste it into a file. Now…
From the last blog post, we saw that there is an issue while updating the name on the home page. To fix that we need to add update the cache mechanism. Let’s add the relevant packages for it.
yarn add @urql/exchange-graphcache
Now we need to add the
At this point, we manage to register a user. Now once a user successfully registers, the user needs to redirect to the home page.
We start with adding
next/router . Then add the redirection to the home page.
In the original video that I follow up to…
map method will take a callback function as an argument and called for every element in the given array. The
map function will return a new array by the result of the calling function. The
map function will not modify the original array. Hence it is an immutable function.
Now we are adding the
GraphQL request when we are making API calls. To do this we are using
URQL GraphQL Client. using below command to add the relevant packages to the web app.
yarn add urql graphql
Then we are adding the provider and client in