You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed that errors originating from Graphcache updaters appear to get swallowed. This took me quite a while to figure out why my mutations were executing twice all of a sudden, and it was eventually discovered to be due to my cache.invalidate() logic that was throwing an error. I don't believe errors should be caught and swallowed like they are now as it makes debugging quite difficult, and prevents error tracing tools from being able to catch potential issues in production.
urql version & exchanges:
urql@2.1.3
graphcache@4.3.6
Steps to reproduce
Create an updater that throws such as example below.
Trigger mutation that would run the updater logic
Observe console, etc. that the error isn't visible/obvious
Example:
createClient({exchanges: [dedupExchange,cacheExchange({updates: {Mutation: {insertTodo(_result,args,cache,_info){thrownewError("You should see this somewhere");}},},}),fetchExchange,]})
Expected behavior
I would expect a catastrophic error in an updater to be visible to the developer, ideally by throwing all the way up so that error tracing tools can catch and report on it. I spent quite a bit of time wondering why my mutation was causing two identical HTTP requests and realized that my updater was erroring out after careful debugging.
Actual behavior
Error in updater is swallowed, and the mutation runs twice instead of once, creating two todo items.
The text was updated successfully, but these errors were encountered:
I've noticed that errors originating from Graphcache updaters appear to get swallowed. This took me quite a while to figure out why my mutations were executing twice all of a sudden, and it was eventually discovered to be due to my
cache.invalidate()
logic that was throwing an error. I don't believe errors should be caught and swallowed like they are now as it makes debugging quite difficult, and prevents error tracing tools from being able to catch potential issues in production.urql version & exchanges:
urql@2.1.3
graphcache@4.3.6
Steps to reproduce
Example:
Expected behavior
I would expect a catastrophic error in an updater to be visible to the developer, ideally by throwing all the way up so that error tracing tools can catch and report on it. I spent quite a bit of time wondering why my mutation was causing two identical HTTP requests and realized that my updater was erroring out after careful debugging.
Actual behavior
Error in updater is swallowed, and the mutation runs twice instead of once, creating two todo items.
The text was updated successfully, but these errors were encountered: