From 4658fe2073dd6285953a08ce380236f88166657b Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Wed, 22 Jul 2026 00:25:58 +0200 Subject: [PATCH] Fix library gql query caching issue With 8b8da3033556a257badd03f1fcdadefaa15912bc the library now calls `useGetMigratableSources` which uses the same `mangas` query as `GET_LIBRARY_MANGA_COUNT`. However, they select different fields, which causes the cache to get overwritte, because it apollo-client wasn't merging the results. --- src/lib/requests/client/GraphQLClient.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/requests/client/GraphQLClient.ts b/src/lib/requests/client/GraphQLClient.ts index ca50221f..3c307e0d 100644 --- a/src/lib/requests/client/GraphQLClient.ts +++ b/src/lib/requests/client/GraphQLClient.ts @@ -136,6 +136,12 @@ const typePolicies: TypedTypePolicies = { lastSyncStatus(_, { toReference }) { return toReference({ __typename: 'SyncStatus', key: {} }); }, + mangas: { + keyArgs: ['condition', 'filter', 'orderBy', 'orderByType', 'order'], + merge(existing, incoming, { mergeObjects }) { + return mergeObjects(existing, incoming); + }, + }, chapters: { keyArgs: ['condition', 'filter', 'orderBy', 'orderByType', 'order'], merge(existing, incoming) {