Skip to content

Commit

Permalink
Exclude "cursor" argument to prevent separate cache instance (#10144)
Browse files Browse the repository at this point in the history
keyArgs must be set to false to properly merge multiple requests when paging because "cursor" is passed in as a query variable (even though it isn't referenced in the merge function)
  • Loading branch information
solarisn authored Dec 7, 2022
1 parent 9f8fae1 commit 21c7d26
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/pagination/cursor-based.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ const cache = new InMemoryCache({
Query: {
fields: {
moreComments: {
keyArgs: false,
merge(existing, incoming, { readField }) {
const comments = existing ? { ...existing.comments } : {};
incoming.comments.forEach(comment => {
Expand Down

0 comments on commit 21c7d26

Please sign in to comment.