Skip to content
Open
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/loud-bulldogs-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/client": patch
---

Fix an issue where a `@defer` query reported the `dataState` as `complete` instead of `streaming` when an error occurs on a deferred field that bubbled to the defer boundary.
4 changes: 2 additions & 2 deletions src/core/QueryInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ export class QueryInfo<

if (
dataState === "complete" ||
(returnPartialData && dataState === "partial" && shouldWrite) ||
(this.hasNext && dataState === "streaming")
dataState === "streaming" ||
(returnPartialData && dataState === "partial" && shouldWrite)
) {
result = { ...result, data: diffResult, dataState };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2506,13 +2506,13 @@ test("stream that returns an error but continues to stream", async () => {

await expect(observableStream).toEmitTypedValue({
loading: false,
data: {
data: markAsStreaming({
hero: {
__typename: "Hero",
id: "1",
name: "slow",
},
},
}),
error: new CombinedGraphQLErrors({
data: {
hero: {
Expand All @@ -2529,9 +2529,9 @@ test("stream that returns an error but continues to stream", async () => {
},
],
}),
dataState: "complete",
dataState: "streaming",
networkStatus: NetworkStatus.error,
partial: false,
partial: true,
});
});

Expand Down
Loading