-
I'm sure I'm doing something wrong, but the behavior I'm seeing is just so bizarre, its difficult to explain.. These are my exchanges:
Everything across the app was working great... then I created a useTrack mutation, for analytics purposes:
This also works... but it has started to break something else. In this example, I'm calling the track function before navigating to a different page
now, on this ListView page, I have query in a useEffect like so:
This useEffect was working fine.. but if the track mutation is called first, this useEffect gets stuck in an infinite loop, where myQuery.state.stale will alternate between true and false.. resetting the data in my local state repeatedly... The track mutation and this query are completely unrelated in the cache.. so I am really just at a loss.. if I disable the track mutation, everything works normally with no infinite loops. Is anything obviously wrong here? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Just to follow up here... its seems as though any mutation at all that happens before this query, will cause this issue |
Beta Was this translation helpful? Give feedback.
-
This had to do with queries that were effectively the same, but didn't have IDs.. I'm not sure why a random mutation exposed it.. but that was the culprit |
Beta Was this translation helpful? Give feedback.
This had to do with queries that were effectively the same, but didn't have IDs.. I'm not sure why a random mutation exposed it.. but that was the culprit