urql-graphql / urql

The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
https://urql.dev/goto/docs
MIT License
8.57k stars 445 forks source link

Cache first queries that error execute twice in suspense mode #3347

Closed zenios closed 1 year ago

zenios commented 1 year ago

Describe the bug

When a cache-first query fails and we are using suspense the query is executed twice.

I am not sure if this is actually a bug or the same behaviour as network-only since error queries are not cached so please close it if not.

Reproduction

https://codesandbox.io/p/sandbox/crazy-roman-86cdyn

Urql version

urql v4.0.5

Validations

kitten commented 1 year ago

This is expected, yes. Since errors aren't cached, once the component remounts the request is executed again on mount