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.6k stars 448 forks source link

feat(auth): Handle refreshAuth rejections gracefully #3307

Closed kitten closed 1 year ago

kitten commented 1 year ago

Summary

This adds a catch(errorQueue) case to refreshAuth and replaces finally(flushQueue) with then(flushQueue). The rejection case will issue OperationResults for all Operations in the queue and will pass the authentication error that refreshAuth rejected with on as the network error.

Set of changes