Fix library gql query caching issue

With 8b8da30335 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.
This commit is contained in:
schroda
2026-07-22 00:25:58 +02:00
parent d2a1d0f574
commit 4658fe2073

View File

@@ -136,6 +136,12 @@ const typePolicies: TypedTypePolicies = {
lastSyncStatus(_, { toReference }) { lastSyncStatus(_, { toReference }) {
return toReference({ __typename: 'SyncStatus', key: {} }); return toReference({ __typename: 'SyncStatus', key: {} });
}, },
mangas: {
keyArgs: ['condition', 'filter', 'orderBy', 'orderByType', 'order'],
merge(existing, incoming, { mergeObjects }) {
return mergeObjects(existing, incoming);
},
},
chapters: { chapters: {
keyArgs: ['condition', 'filter', 'orderBy', 'orderByType', 'order'], keyArgs: ['condition', 'filter', 'orderBy', 'orderByType', 'order'],
merge(existing, incoming) { merge(existing, incoming) {