Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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/slimy-ducks-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/client": patch
---

Update the `accept` header used with the `GraphQL17Alpha9Handler` to `multipart/mixed;incrementalDeliverySpec=graphql/incremental/v0.1` to ensure the newest incremental delivery format is requested.
8 changes: 4 additions & 4 deletions .size-limits.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (CJS)": 44752,
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production) (CJS)": 39500,
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\"": 33897,
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 27749
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (CJS)": 44849,
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production) (CJS)": 39477,
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\"": 33875,
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 27756
}
5 changes: 4 additions & 1 deletion src/incremental/handlers/graphql17Alpha9.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,10 @@ export class GraphQL17Alpha9Handler
if (hasDirectives(["defer", "stream"], request.query)) {
const context = request.context ?? {};
const http = (context.http ??= {});
http.accept = ["multipart/mixed", ...(http.accept || [])];
http.accept = [
"multipart/mixed;incrementalDeliverySpec=graphql/incremental/v0.1",
...(http.accept || []),
];

request.context = context;
}
Expand Down
4 changes: 2 additions & 2 deletions src/link/http/__tests__/HttpLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,7 @@ describe("HttpLink", () => {
headers: {
"content-type": "application/json",
accept:
"multipart/mixed,application/graphql-response+json,application/json;q=0.9",
"multipart/mixed;incrementalDeliverySpec=graphql/incremental/v0.1,application/graphql-response+json,application/json;q=0.9",
},
})
);
Expand Down Expand Up @@ -1744,7 +1744,7 @@ describe("HttpLink", () => {
headers: {
"content-type": "application/json",
accept:
"multipart/mixed,application/graphql-response+json,application/json;q=0.9",
"multipart/mixed;incrementalDeliverySpec=graphql/incremental/v0.1,application/graphql-response+json,application/json;q=0.9",
},
})
);
Expand Down