Bug Report
Critical data loss regression after upgrading from Apollo Client 3.14.0 to 4.0.7. Apollo Client v4 changed how deferred responses are processed, breaking the merge behavior.
Versions
- Working:
@apollo/client: ^3.14.0
- Broken:
@apollo/client: 4.0.7
Response Flow Comparison
I created a custom link that prints the result object in both versions
First Response: (version 3 and 4)
{
"data": {
"items": {
"nodes": [
{
"id": "fc5028dd-c7a1-53ca-98ed-df72e419bcf6",
"__typename": "Item"
},
{
"id": "f8be4846-0c59-57e3-8a13-c8eff54553d9",
"__typename": "Item"
}
],
"pageInfo": {
"endCursor": "1",
"hasNextPage": true,
"__typename": "PageInfo"
},
"totalCount": 3651,
"__typename": "ItemConnection"
}
},
"hasNext": true
}
Second Response v3
{
// ✅ COMPLETE merged data with both initial AND deferred fields
"data": {
"items": {
"__typename": "ItemConnection",
"nodes": [
{
"__typename": "Item",
"id": "fc5028dd-c7a1-53ca-98ed-df72e419bcf6",
"name": "Item 1"
},
{
"__typename": "Item",
"id": "f8be4846-0c59-57e3-8a13-c8eff54553d9",
"name": "Item 2"
}
],
"pageInfo": {
"__typename": "Item",
"endCursor": "1",
"hasNextPage": true
},
"totalCount": 3651
}
},
"hasNext": false,
"incremental": [
{
"data": {
"name": "Item 1",
"__typename": "Item"
},
"path": [
"items",
"nodes",
0
]
},
{
"data": {
"name": "Item 2",
"__typename": "Item"
},
"path": [
"items",
"nodes",
1
]
}
]
}
Second Response v4
{
"data": // ❌ No complete merged data provided
"hasNext": false,
"incremental": [
{
"data": {
"name": "Item 1",
"__typename": "Item"
},
"path": [
"items",
"nodes",
0
]
},
{
"data": {
"name": "Item 2",
"__typename": "Item"
},
"path": [
"items",
"nodes",
1
]
}
]
}
Bug Report
Critical data loss regression after upgrading from Apollo Client 3.14.0 to 4.0.7. Apollo Client v4 changed how deferred responses are processed, breaking the merge behavior.
Versions
@apollo/client: ^3.14.0@apollo/client: 4.0.7Response Flow Comparison
I created a custom link that prints the result object in both versions
First Response: (version 3 and 4)
Second Response v3
Second Response v4