Skip to content
Merged
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/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;incrementalSpec=v0.2` 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)": 44831,
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production) (CJS)": 39452,
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\"": 33875,
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 27756
}
6 changes: 5 additions & 1 deletion src/incremental/handlers/graphql17Alpha9.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,11 @@ export class GraphQL17Alpha9Handler
if (hasDirectives(["defer", "stream"], request.query)) {
const context = request.context ?? {};
const http = (context.http ??= {});
http.accept = ["multipart/mixed", ...(http.accept || [])];
// https://specs.apollo.dev/incremental/v0.2/
http.accept = [
"multipart/mixed;incrementalSpec=v0.2",
...(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;incrementalSpec=v0.2,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;incrementalSpec=v0.2,application/graphql-response+json,application/json;q=0.9",
},
})
);
Expand Down