Open liquiad opened 3 years ago
I've noticed the same problem.
Maybe related https://github.com/apollographql/apollo-client/issues/2513
@liquiad The solution is simple.
https://www.apollographql.com/docs/react/data/error-handling/
when I create my query I add the options as indicated in the link above
let issueQuery = query(api.issues, {variables:{jql:""},errorPolicy:"all"} )
This tells the apollo engine to forward all errors to the application and keep the connection alive. By default apollo will treat all errors like network errors and disconnect.
If a query returns an error, the store no longer updates with the newest data when using refetch. Is this intentional behavior?
Here's an example, I created a query that returns the time, and it will generate an error every odd second, just for testing purposes.
Then I created my App.svelte with the following code:
If the query returns an error, either when loading the app or when pressing refresh, refetch no longer updates the store. Once it errors, the reactive if-blocks stop working, even if the refetch request is successful.
Sorry if I'm just misunderstanding something, I'm very new to Svelte and GraphQL entirely.