Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/healthy-pets-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/client": patch
---

Work around a potential feud when a `read` function is present on an entity with a non-normalizable child (#7028)
11 changes: 11 additions & 0 deletions src/core/QueryInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,17 @@ export class QueryInfo {
diff: Cache.DiffResult<any> | null,
options?: Cache.DiffOptions
) {
// some very long comment about feuds
if (
diff &&
!diff.complete &&
this.lastDiff &&
this.lastDiff.diff.complete &&
this.lastWrite &&
this.lastWrite.dmCount === destructiveMethodCounts.get(this.cache)
) {
return;
}
this.lastDiff =
diff ?
{
Expand Down
18 changes: 1 addition & 17 deletions src/core/__tests__/QueryManager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2397,23 +2397,7 @@ describe("QueryManager", () => {
},
},
});
} else if (count === 3) {
expect(result).toEqual({
loading: true,
networkStatus: NetworkStatus.loading,
data: {
info: {},
},
partial: true,
});
} else if (count === 4) {
expect(result).toEqual({
loading: false,
networkStatus: NetworkStatus.ready,
data: {
info: {},
},
});
Comment on lines -2400 to -2416
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably good that this isn't happening anymore - that doesn't seem like desirable behaviour?


setTimeout(resolve, 100);
} else {
reject(new Error(`Unexpected ${JSON.stringify({ count, result })}`));
Expand Down