Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache update errors are caught #2191

Closed
bkiac opened this issue Jan 10, 2022 · 1 comment · Fixed by #2210
Closed

Cache update errors are caught #2191

bkiac opened this issue Jan 10, 2022 · 1 comment · Fixed by #2210
Labels
bug 🐛 Oh no! A bug or unintented behaviour.

Comments

@bkiac
Copy link

bkiac commented Jan 10, 2022

I had an error in my update resolver logic which was really hard to find because the error was caught by the cache exchange like nothing happened. I'm not sure if this is intentional or not.

urql version & exchanges:

urql 2.0.6
@urql/exchange-graphcache 4.3.6

Steps to reproduce

const cache: GraphCacheConfig = cacheExchange({
	schema,
	updates: {
		Mutation: {
			doSomething: () => {
				throw new Error("this is caught")
			},
		},
	},
})

Expected behavior
Errors are propagated/re-thrown

Actual behavior
Errors are caught inside the cache exchange

@bkiac bkiac added the bug 🐛 Oh no! A bug or unintented behaviour. label Jan 10, 2022
@JoviDeCroock
Copy link
Collaborator

JoviDeCroock commented Jan 10, 2022

Nothing in urql is catching these we are throwing them for the user, here is a simple reproduction highlighting this case. When you press a todo it will throw an error.

EDIT: updating to 2.0.6 seems to introduce this issue 😅 this issue seems to be introduced in 2.0.5. This bug seems related to the changes we did in core at 2.3.0, the incremental delivery is eating the error and returning it as an error instead

@JoviDeCroock JoviDeCroock added needs more info ✋ A question or report that needs more info to be addressable bug 🐛 Oh no! A bug or unintented behaviour. and removed bug 🐛 Oh no! A bug or unintented behaviour. needs more info ✋ A question or report that needs more info to be addressable labels Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Oh no! A bug or unintented behaviour.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants