Re-executing query with urql/svelte doesn't appear to do anything #3488
Replies: 1 comment
-
This is because neither the Sources in To put it practically, sources created by
On a side-note, triggering queries manually after mutations is a bit of an anti-pattern, so I'd consider looking into normal cache mechanisms to invalidate query results before doing this. |
Beta Was this translation helpful? Give feedback.
-
I have a SPA with SvelteKit that I'm trying to use urql with. One of my pages has a "create" button that fires off a mutation. This button is on the same page as the list of these objects. That seems like a pretty straight forward use case, but I cannot for the life of me get the query to rerun. Here's what I'm trying:
Client has
devtoolsExchange
,cacheExchange
,retryExchange
, andfetchExchange
.On my
+page.svelte
:Inside my button handler on the same page, I have this:
That
connectionsQuery
never runs a second time. I do not see it in devtools or network requests at all. How can I get that to rerun? I've tried setting the first time I run it to also havenetwork-only
but that did not help.I have also tried changing the button click handler to look like this:
The second query also does not run in this instance.
What am I doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions