Skip to content

Commit 535a998

Browse files
authored
Merge branch 'release-4.0' into lenz/pr/abortcontroller-tracking
2 parents 9abdffc + 81b03d8 commit 535a998

44 files changed

Lines changed: 1816 additions & 900 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.api-reports/api-report-link_batch-http.api.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,38 @@
55
```ts
66

77
import { ApolloLink } from '@apollo/client/link';
8+
import type { BaseHttpLink } from '@apollo/client/link/http';
89
import { BatchLink } from '@apollo/client/link/batch';
910
import { ClientAwarenessLink } from '@apollo/client/link/client-awareness';
10-
import type { HttpLink } from '@apollo/client/link/http';
1111
import { Observable } from 'rxjs';
1212

1313
// @public (undocumented)
14+
export namespace BaseBatchHttpLink {
15+
export interface ContextOptions extends BaseHttpLink.ContextOptions {
16+
}
17+
export interface Options extends BatchLink.Shared.Options, BaseHttpLink.Shared.Options {
18+
batchMax?: number;
19+
}
20+
}
21+
22+
// @public
1423
export class BaseBatchHttpLink extends ApolloLink {
15-
constructor(fetchParams?: BatchHttpLink.Options);
24+
constructor(options?: BaseBatchHttpLink.Options);
1625
// (undocumented)
1726
request(operation: ApolloLink.Operation, forward: ApolloLink.ForwardFunction): Observable<ApolloLink.Result>;
1827
}
1928

2029
// @public (undocumented)
2130
export namespace BatchHttpLink {
22-
export interface ContextOptions extends HttpLink.ContextOptions {
31+
export interface ContextOptions extends BaseBatchHttpLink.ContextOptions, ClientAwarenessLink.ContextOptions {
2332
}
24-
export interface Options extends BatchLink.Shared.Options, HttpLink.Shared.Options {
25-
batchMax?: number;
33+
export interface Options extends BaseBatchHttpLink.Options, ClientAwarenessLink.Options {
2634
}
2735
}
2836

2937
// @public
3038
export class BatchHttpLink extends ApolloLink {
31-
constructor(options?: BatchHttpLink.Options & ClientAwarenessLink.Options);
39+
constructor(options?: BatchHttpLink.Options);
3240
}
3341

3442
// (No @packageDocumentation comment for this package)

.api-reports/api-report-link_batch.api.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ import type { Observable } from 'rxjs';
99

1010
// @public (undocumented)
1111
export namespace BatchLink {
12-
// (undocumented)
1312
export type BatchHandler = (operations: ApolloLink.Operation[], forward: ApolloLink.ForwardFunction[]) => Observable<ApolloLink.Result[]>;
14-
// (undocumented)
1513
export interface Options extends Shared.Options {
1614
batchHandler?: BatchLink.BatchHandler;
1715
batchMax?: number;
@@ -27,9 +25,9 @@ export namespace BatchLink {
2725
}
2826
}
2927

30-
// @public (undocumented)
28+
// @public
3129
export class BatchLink extends ApolloLink {
32-
constructor(fetchParams?: BatchLink.Options);
30+
constructor(options?: BatchLink.Options);
3331
// (undocumented)
3432
request(operation: ApolloLink.Operation, forward: ApolloLink.ForwardFunction): Observable<ApolloLink.Result>;
3533
}

.api-reports/api-report-link_client-awareness.api.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ export namespace ClientAwarenessLink {
1414
transport?: "headers" | false;
1515
version?: string;
1616
}
17+
export interface ContextOptions {
18+
clientAwareness?: ClientAwarenessLink.ClientAwarenessOptions;
19+
}
1720
// (undocumented)
1821
export interface EnhancedClientAwarenessOptions {
1922
transport?: "extensions" | false;
@@ -27,7 +30,7 @@ export namespace ClientAwarenessLink {
2730

2831
// @public
2932
export class ClientAwarenessLink extends ApolloLink {
30-
constructor(constructorOptions?: ClientAwarenessLink.Options);
33+
constructor(options?: ClientAwarenessLink.Options);
3134
}
3235

3336
// (No @packageDocumentation comment for this package)

.api-reports/api-report-link_context.api.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ export function setContext(setter: SetContextLink.LegacyContextSetter): SetConte
1111

1212
// @public (undocumented)
1313
export namespace SetContextLink {
14+
export type ContextSetter = (prevContext: Readonly<ApolloLink.OperationContext>, operation: SetContextLink.SetContextOperation) => Promise<Partial<ApolloLink.OperationContext>> | Partial<ApolloLink.OperationContext>;
15+
// @deprecated (undocumented)
16+
export type LegacyContextSetter = (operation: SetContextLink.SetContextOperation, prevContext: Readonly<ApolloLink.OperationContext>) => Promise<Partial<ApolloLink.OperationContext>> | Partial<ApolloLink.OperationContext>;
1417
// (undocumented)
15-
export type ContextSetter = (prevContext: ApolloLink.OperationContext, operation: SetContextOperation) => Promise<Partial<ApolloLink.OperationContext>> | Partial<ApolloLink.OperationContext>;
16-
// (undocumented)
17-
export type LegacyContextSetter = (operation: SetContextOperation, prevContext: ApolloLink.OperationContext) => Promise<Partial<ApolloLink.OperationContext>> | Partial<ApolloLink.OperationContext>;
18-
// (undocumented)
18+
export namespace SetContextLinkDocumentationTypes {
19+
export function ContextSetter(prevContext: Readonly<ApolloLink.OperationContext>, operation: SetContextLink.SetContextOperation): Promise<Partial<ApolloLink.OperationContext>> | Partial<ApolloLink.OperationContext>;
20+
}
1921
export type SetContextOperation = Omit<ApolloLink.Operation, "getContext" | "setContext">;
2022
}
2123

22-
// @public (undocumented)
24+
// @public
2325
export class SetContextLink extends ApolloLink {
2426
constructor(setter: SetContextLink.ContextSetter);
2527
}

.api-reports/api-report-link_http.api.md

Lines changed: 62 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,67 @@
77
import { ApolloLink } from '@apollo/client/link';
88
import type { ASTNode } from 'graphql';
99
import { ClientAwarenessLink } from '@apollo/client/link/client-awareness';
10-
import type { print as print_2 } from '@apollo/client/utilities';
10+
import type { print as print_2 } from 'graphql';
1111

1212
// @public (undocumented)
13+
export namespace BaseHttpLink {
14+
// (undocumented)
15+
export interface Body {
16+
// (undocumented)
17+
extensions?: Record<string, any>;
18+
// (undocumented)
19+
operationName?: string;
20+
// (undocumented)
21+
query?: string;
22+
// (undocumented)
23+
variables?: Record<string, any>;
24+
}
25+
export interface ContextOptions {
26+
credentials?: RequestCredentials;
27+
fetchOptions?: RequestInit;
28+
headers?: Record<string, string>;
29+
http?: BaseHttpLink.HttpOptions;
30+
uri?: string | BaseHttpLink.UriFunction;
31+
}
32+
export interface HttpOptions {
33+
accept?: string[];
34+
includeExtensions?: boolean;
35+
includeQuery?: boolean;
36+
preserveHeaderCase?: boolean;
37+
}
38+
export interface Options extends Shared.Options {
39+
useGETForQueries?: boolean;
40+
}
41+
// (undocumented)
42+
export type Printer = (node: ASTNode, originalPrint: typeof print_2) => string;
43+
// (undocumented)
44+
export namespace Shared {
45+
export interface Options {
46+
credentials?: RequestCredentials;
47+
fetch?: typeof fetch;
48+
fetchOptions?: RequestInit;
49+
headers?: Record<string, string>;
50+
includeExtensions?: boolean;
51+
includeUnusedVariables?: boolean;
52+
preserveHeaderCase?: boolean;
53+
print?: BaseHttpLink.Printer;
54+
uri?: string | BaseHttpLink.UriFunction;
55+
}
56+
}
57+
// (undocumented)
58+
export type UriFunction = (operation: ApolloLink.Operation) => string;
59+
}
60+
61+
// @public
1362
export class BaseHttpLink extends ApolloLink {
14-
constructor(linkOptions?: HttpLink.Options);
63+
constructor(options?: BaseHttpLink.Options);
1564
}
1665

1766
// @public (undocumented)
1867
export const checkFetcher: (fetcher: typeof fetch | undefined) => void;
1968

2069
// @public @deprecated (undocumented)
21-
export const createHttpLink: (linkOptions?: HttpLink.Options & ClientAwarenessLink.Options) => HttpLink;
70+
export const createHttpLink: (options?: HttpLink.Options) => HttpLink;
2271

2372
// @public @deprecated (undocumented)
2473
export const createSignalIfSupported: () => {
@@ -30,11 +79,11 @@ export const createSignalIfSupported: () => {
3079
};
3180

3281
// @public (undocumented)
33-
export const defaultPrinter: HttpLink.Printer;
82+
export const defaultPrinter: BaseHttpLink.Printer;
3483

3584
// @public (undocumented)
3685
export const fallbackHttpConfig: {
37-
http: HttpLink.HttpOptions;
86+
http: BaseHttpLink.HttpOptions;
3887
headers: {
3988
accept: string;
4089
"content-type": string;
@@ -51,70 +100,29 @@ interface HttpConfig {
51100
// (undocumented)
52101
headers?: Record<string, string>;
53102
// (undocumented)
54-
http?: HttpLink.HttpOptions;
103+
http?: BaseHttpLink.HttpOptions;
55104
// (undocumented)
56105
options?: any;
57106
}
58107

59108
// @public (undocumented)
60109
export namespace HttpLink {
61-
// (undocumented)
62-
export interface Body {
63-
// (undocumented)
64-
extensions?: Record<string, any>;
65-
// (undocumented)
66-
operationName?: string;
67-
// (undocumented)
68-
query?: string;
69-
// (undocumented)
70-
variables?: Record<string, any>;
110+
export interface ContextOptions extends BaseHttpLink.ContextOptions, ClientAwarenessLink.ContextOptions {
71111
}
72-
export interface ContextOptions {
73-
credentials?: RequestCredentials;
74-
fetchOptions?: RequestInit;
75-
headers?: Record<string, string>;
76-
http?: HttpLink.HttpOptions;
77-
uri?: string | HttpLink.UriFunction;
112+
export interface Options extends BaseHttpLink.Options, ClientAwarenessLink.Options {
78113
}
79-
export interface HttpOptions {
80-
accept?: string[];
81-
includeExtensions?: boolean;
82-
includeQuery?: boolean;
83-
preserveHeaderCase?: boolean;
84-
}
85-
export interface Options extends Shared.Options {
86-
useGETForQueries?: boolean;
87-
}
88-
// (undocumented)
89-
export type Printer = (node: ASTNode, originalPrint: typeof print_2) => string;
90-
// (undocumented)
91-
export namespace Shared {
92-
export interface Options {
93-
credentials?: RequestCredentials;
94-
fetch?: typeof fetch;
95-
fetchOptions?: RequestInit;
96-
headers?: Record<string, string>;
97-
includeExtensions?: boolean;
98-
includeUnusedVariables?: boolean;
99-
preserveHeaderCase?: boolean;
100-
print?: HttpLink.Printer;
101-
uri?: string | HttpLink.UriFunction;
102-
}
103-
}
104-
// (undocumented)
105-
export type UriFunction = (operation: ApolloLink.Operation) => string;
106114
}
107115

108116
// @public
109117
export class HttpLink extends ApolloLink {
110-
constructor(options?: HttpLink.Options & ClientAwarenessLink.Options);
118+
constructor(options?: HttpLink.Options);
111119
}
112120

113121
// @public (undocumented)
114122
export function parseAndCheckHttpResponse(operations: ApolloLink.Operation | ApolloLink.Operation[]): (response: Response) => Promise<any>;
115123

116124
// @public (undocumented)
117-
export function rewriteURIForGET(chosenURI: string, body: HttpLink.Body): {
125+
export function rewriteURIForGET(chosenURI: string, body: BaseHttpLink.Body): {
118126
parseError: unknown;
119127
newURI?: undefined;
120128
} | {
@@ -127,13 +135,13 @@ export function rewriteURIForGET(chosenURI: string, body: HttpLink.Body): {
127135
// @public (undocumented)
128136
export function selectHttpOptionsAndBody(operation: ApolloLink.Operation, fallbackConfig: HttpConfig, ...configs: Array<HttpConfig>): {
129137
options: HttpConfig & Record<string, any>;
130-
body: HttpLink.Body;
138+
body: BaseHttpLink.Body;
131139
};
132140

133141
// @public (undocumented)
134-
export function selectHttpOptionsAndBodyInternal(operation: ApolloLink.Operation, printer: HttpLink.Printer, ...configs: HttpConfig[]): {
142+
export function selectHttpOptionsAndBodyInternal(operation: ApolloLink.Operation, printer: BaseHttpLink.Printer, ...configs: HttpConfig[]): {
135143
options: HttpConfig & Record<string, any>;
136-
body: HttpLink.Body;
144+
body: BaseHttpLink.Body;
137145
};
138146

139147
// @public (undocumented)

.api-reports/api-report-link_persisted-queries.api.md

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,60 +16,45 @@ export const createPersistedQueryLink: (options: PersistedQueryLink.Options) =>
1616
export namespace PersistedQueryLink {
1717
// (undocumented)
1818
export namespace Base {
19-
// (undocumented)
2019
export interface Options {
21-
// (undocumented)
2220
disable?: (options: PersistedQueryLink.DisableFunctionOptions) => boolean;
23-
// (undocumented)
2421
retry?: (options: PersistedQueryLink.RetryFunctionOptions) => boolean;
25-
// (undocumented)
2622
useGETForHashedQueries?: boolean;
2723
}
2824
}
29-
// (undocumented)
3025
export interface DisableFunctionOptions extends PersistedQueryLink.RetryFunctionOptions {
3126
}
32-
// (undocumented)
3327
export interface ErrorMeta {
34-
// (undocumented)
3528
persistedQueryNotFound: boolean;
36-
// (undocumented)
3729
persistedQueryNotSupported: boolean;
3830
}
39-
// (undocumented)
4031
export type GenerateHashFunction = (document: DocumentNode) => string | PromiseLike<string>;
41-
// (undocumented)
4232
export interface GenerateHashOptions extends Base.Options {
43-
// (undocumented)
4433
generateHash: PersistedQueryLink.GenerateHashFunction;
4534
// (undocumented)
4635
sha256?: never;
4736
}
48-
// (undocumented)
4937
export type Options = PersistedQueryLink.SHA256Options | PersistedQueryLink.GenerateHashOptions;
5038
// (undocumented)
39+
export namespace PersistedQueryLinkDocumentationTypes {
40+
export function GenerateHashFunction(document: DocumentNode): string | PromiseLike<string>;
41+
export function SHA256Function(queryString: string): string | PromiseLike<string>;
42+
}
5143
export interface RetryFunctionOptions {
52-
// (undocumented)
5344
error: ErrorLike;
54-
// (undocumented)
5545
meta: PersistedQueryLink.ErrorMeta;
56-
// (undocumented)
5746
operation: ApolloLink.Operation;
58-
// (undocumented)
5947
result?: FormattedExecutionResult;
6048
}
61-
// (undocumented)
6249
export type SHA256Function = (queryString: string) => string | PromiseLike<string>;
63-
// (undocumented)
6450
export interface SHA256Options extends Base.Options {
6551
// (undocumented)
6652
generateHash?: never;
67-
// (undocumented)
6853
sha256: PersistedQueryLink.SHA256Function;
6954
}
7055
}
7156

72-
// @public (undocumented)
57+
// @public
7358
export class PersistedQueryLink extends ApolloLink {
7459
constructor(options: PersistedQueryLink.Options);
7560
// (undocumented)

.api-reports/api-report-link_remove-typename.api.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,24 @@
66

77
import { ApolloLink } from '@apollo/client/link';
88

9-
// @public (undocumented)
9+
// @public
1010
export const KEEP = "__KEEP";
1111

1212
// @public @deprecated (undocumented)
1313
export function removeTypenameFromVariables(options?: RemoveTypenameFromVariablesLink.Options): RemoveTypenameFromVariablesLink;
1414

1515
// @public (undocumented)
1616
export namespace RemoveTypenameFromVariablesLink {
17-
// (undocumented)
1817
export interface KeepTypenameConfig {
1918
// (undocumented)
2019
[key: string]: typeof KEEP | RemoveTypenameFromVariablesLink.KeepTypenameConfig;
2120
}
22-
// (undocumented)
2321
export interface Options {
24-
// (undocumented)
2522
except?: RemoveTypenameFromVariablesLink.KeepTypenameConfig;
2623
}
2724
}
2825

29-
// @public (undocumented)
26+
// @public
3027
export class RemoveTypenameFromVariablesLink extends ApolloLink {
3128
constructor(options?: RemoveTypenameFromVariablesLink.Options);
3229
}

0 commit comments

Comments
 (0)