make getting more freebies work

This commit is contained in:
keyan 2022-10-03 16:05:06 -05:00
parent f6c5644311
commit 5ca67c3411
1 changed files with 13 additions and 0 deletions

View File

@ -78,6 +78,19 @@ export default function getApolloClient () {
}
}
},
freebieItems: {
keyArgs: [],
merge (existing, incoming) {
if (isFirstPage(incoming.cursor, existing?.items)) {
return incoming
}
return {
cursor: incoming.cursor,
items: [...(existing?.items || []), ...incoming.items]
}
}
},
search: {
keyArgs: ['q'],
merge (existing, incoming) {