You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building an example in Next.js. This is the stack:
react-query/graphql-request
Next.js
Apollo Server
FaunaDB
I'm using refetchOnWindowFocus = true because I'm looking to validate the user's token every time the user looks at the window for the first time, each time.
But the unusual behavior is that the useQuery is running twice (this line), whenever the window is focused.
You can see the same behavior in production here. Just log in with the example credentials and start switching windows. From time to time you'll see the message Validation success pop up twice from time to time.
Do you have any ideas about what might be causing this behavior? Any comment is very much appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey everyone!
I'm building an example in Next.js. This is the stack:
I'm using
refetchOnWindowFocus = true
because I'm looking to validate the user's token every time the user looks at the window for the first time, each time.But the unusual behavior is that the
useQuery
is running twice (this line), whenever the window is focused.You can see the same behavior in production here. Just log in with the example credentials and start switching windows. From time to time you'll see the message
Validation success
pop up twice from time to time.Do you have any ideas about what might be causing this behavior? Any comment is very much appreciated.
Video demonstrating the behavior: https://www.loom.com/share/5f0760206645402896b751367f90b776
Thank you very much
Beta Was this translation helpful? Give feedback.
All reactions