From 9d12f8ad9b188020ecf2128a496e29ba5c858cd8 Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Tue, 18 Apr 2023 13:28:46 +0100 Subject: [PATCH] fix(graphcache): Fix offlineExchange duplicating offline mutations --- .changeset/warm-poets-battle.md | 5 +++++ exchanges/graphcache/src/offlineExchange.ts | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/warm-poets-battle.md diff --git a/.changeset/warm-poets-battle.md b/.changeset/warm-poets-battle.md new file mode 100644 index 0000000000..5034aae4d8 --- /dev/null +++ b/.changeset/warm-poets-battle.md @@ -0,0 +1,5 @@ +--- +'@urql/exchange-graphcache': patch +--- + +Fix `offlineExchange` duplicating offline mutations in failed queue. diff --git a/exchanges/graphcache/src/offlineExchange.ts b/exchanges/graphcache/src/offlineExchange.ts index 3c0172fef0..6a801534be 100644 --- a/exchanges/graphcache/src/offlineExchange.ts +++ b/exchanges/graphcache/src/offlineExchange.ts @@ -1,4 +1,4 @@ -import { pipe, merge, makeSubject, filter } from 'wonka'; +import { pipe, share, merge, makeSubject, filter } from 'wonka'; import { SelectionNode } from '@0no-co/graphql.web'; import { @@ -180,7 +180,8 @@ export const offlineExchange = } return true; - }) + }), + share ); };