How to fire mutation with url query param only once
I have a simple page that has a url like that:
/confirm-email?token=<token-value>
Now when the user visits that page I want to confirm the email with the token from the url with useMutation.
However the mutation is firing in a loop, how can I avoid this?
Solution:Jump to solution
https://github.com/trojanowski/react-apollo-hooks/issues/205#issuecomment-1032336686
found a solution here. sneaky one...
GitHub
Calling a mutation within React.useEffect causes infinite loop · Is...
I'm attempting to perform a mutation when a specific route is hit in my application. When using useEffect and passing through a mutation method as a dependancy, it enters an infinite loop. cons...
1 Reply
Solution
https://github.com/trojanowski/react-apollo-hooks/issues/205#issuecomment-1032336686
found a solution here. sneaky one
GitHub
Calling a mutation within React.useEffect causes infinite loop · Is...
I'm attempting to perform a mutation when a specific route is hit in my application. When using useEffect and passing through a mutation method as a dependancy, it enters an infinite loop. cons...