Replies: 1 comment 1 reply
-
I'm not sure if I understand the whole picture, but I think you only want to run the query if Otherwise maybe adding a new flag to the initial state as you need. Mixing 2 state management libraries always get a bit complicated 😅 About the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey!
Currently, I only fetch my data if the store doesn't have it already, which works good until I want to manipulate the data e.g. adding an entry by submitting a form. Because the store already has data in it, it doesn't refetch and update the previous stored data.
My code looks like this
If I remove the
if (!items.value.length)
, it works because it always refetches the current data. But it also calls the query on each request. Because of this, the shown data "flickers" a bit.What would be the workaround for this? I think it's not urql related, but has to do with refetching the latest data if I'm right.
Maybe setting a kind of flag to trigger the code inside the
if()
would help?Beta Was this translation helpful? Give feedback.
All reactions