-
Right now I have something like this: <Button
on:click={async () => {
await shuffleCardsMutation();
$listCardsQuery.context = { requestPolicy: 'cache-and-network', forceUpdate: Date.now() };
}}>
Shuffle Cards
</Button> This works, but setting the Is this currently the most idiomatic way of getting this result? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You actually shouldn't need to set The problem here is partly reactivity in Svelte being a little odd compared to other frameworks as it doesn't appear functional, but all that's being done here is updating the inputs to the query call which will automatically restart it |
Beta Was this translation helpful? Give feedback.
You actually shouldn't need to set
forceUpdate
. Instead the most idiomatic method here is to setrequestPolicy
tonetworkOnly
: https://formidable.com/open-source/urql/docs/concepts/core-package/The problem here is partly reactivity in Svelte being a little odd compared to other frameworks as it doesn't appear functional, but all that's being done here is updating the inputs to the query call which will automatically restart it