Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
e10061f
Add some doc blocks to retry link
jerelmiller Aug 4, 2025
271960f
Update retry link
jerelmiller Aug 4, 2025
5941059
Update doc blocks for delay/retry functions
jerelmiller Aug 4, 2025
0a63ad4
Add back code example
jerelmiller Aug 4, 2025
cf6060d
Add doc blocks for RemoveTypenameFromVariablesLink
jerelmiller Aug 4, 2025
80f251c
Update RemoveTypenameFromVariablesLink doc
jerelmiller Aug 4, 2025
17e6380
More tweaks to doc blocks
jerelmiller Aug 4, 2025
b1465ee
Add types to schema link doc
jerelmiller Aug 5, 2025
b13c128
Set prevContext to readonly in SetContextLink
jerelmiller Aug 5, 2025
65a9e97
Add constructor signature to SchemaLink doc
jerelmiller Aug 5, 2025
f6fd917
Use full qualifier
jerelmiller Aug 5, 2025
5254d2d
Deprecate the LegacyContextSetter type
jerelmiller Aug 5, 2025
45b8661
Update SetContextLink
jerelmiller Aug 5, 2025
3798498
Update function docs
jerelmiller Aug 5, 2025
c988016
Remove remarks
jerelmiller Aug 5, 2025
130ca55
Remove italic
jerelmiller Aug 5, 2025
f037d95
Remove unneeded doc block
jerelmiller Aug 5, 2025
f4263b8
Tweak doc
jerelmiller Aug 5, 2025
7517208
Fix typo
jerelmiller Aug 5, 2025
d0bc76b
Update example
jerelmiller Aug 5, 2025
04bd146
Wrap in caution
jerelmiller Aug 5, 2025
c5190a7
Update doc blocks in WebSocketLink
jerelmiller Aug 5, 2025
3949ec7
Update ws docs
jerelmiller Aug 5, 2025
2d9a713
Remove old type
jerelmiller Aug 5, 2025
c2aa5b0
Rename options type in ClientAwarenessLink
jerelmiller Aug 5, 2025
7a3a2a4
Add ClientAwarenessLink constructure signature
jerelmiller Aug 5, 2025
4ea6856
Add doc block for intro
jerelmiller Aug 5, 2025
fe4aca1
Doc blocks for remaining options
jerelmiller Aug 5, 2025
b5ef8dc
Add codegen doc block types
jerelmiller Aug 5, 2025
2289b12
Use class in code examples
jerelmiller Aug 5, 2025
368bd68
Use notes
jerelmiller Aug 5, 2025
6011f13
Use the class name
jerelmiller Aug 5, 2025
812bb11
Add note
jerelmiller Aug 5, 2025
5072235
Update options and remove object section
jerelmiller Aug 5, 2025
407d1d1
fix canonical references in RemoveTypenameFromVariablesLink
jerelmiller Aug 5, 2025
3d6733b
Rename option
jerelmiller Aug 5, 2025
cc49f62
Initial doc for `BaseHttpLink`
jerelmiller Aug 5, 2025
78ca369
Add ContextOptions type for ClientAwarenessLink
jerelmiller Aug 6, 2025
b877f28
Tweak doc block
jerelmiller Aug 6, 2025
5d60bdd
Change description
jerelmiller Aug 6, 2025
7e434ee
Move most HttpLink options to BaseHttpLink. Multi inherit
jerelmiller Aug 6, 2025
ad3b31b
Add changeset
jerelmiller Aug 6, 2025
f1147c3
Move BatchHttpLink.Options to BaseBatchHttpLink and add multi inherit…
jerelmiller Aug 6, 2025
8d312f6
Add docs page for base batch http link
jerelmiller Aug 6, 2025
3560310
Update constructor type for BatchHttpLink
jerelmiller Aug 6, 2025
6a07ebd
Tweak doc blocks
jerelmiller Aug 6, 2025
be590b9
Add batch link to docs
jerelmiller Aug 6, 2025
0776261
Update api report
jerelmiller Aug 6, 2025
6006c0c
Update size limits
jerelmiller Aug 6, 2025
8e4ea33
Formatting
jerelmiller Aug 6, 2025
4d00299
Remove HttpOptions from basic networking page
jerelmiller Aug 6, 2025
943e322
Fix reference to old class
jerelmiller Aug 6, 2025
d6a21a9
Add key to example
jerelmiller Aug 6, 2025
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
20 changes: 14 additions & 6 deletions .api-reports/api-report-link_batch-http.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,38 @@
```ts

import { ApolloLink } from '@apollo/client/link';
import type { BaseHttpLink } from '@apollo/client/link/http';
import { BatchLink } from '@apollo/client/link/batch';
import { ClientAwarenessLink } from '@apollo/client/link/client-awareness';
import type { HttpLink } from '@apollo/client/link/http';
import { Observable } from 'rxjs';

// @public (undocumented)
export namespace BaseBatchHttpLink {
export interface ContextOptions extends BaseHttpLink.ContextOptions {
}
export interface Options extends BatchLink.Shared.Options, BaseHttpLink.Shared.Options {
batchMax?: number;
}
}

// @public
export class BaseBatchHttpLink extends ApolloLink {
constructor(fetchParams?: BatchHttpLink.Options);
constructor(options?: BaseBatchHttpLink.Options);
// (undocumented)
request(operation: ApolloLink.Operation, forward: ApolloLink.ForwardFunction): Observable<ApolloLink.Result>;
}

// @public (undocumented)
export namespace BatchHttpLink {
export interface ContextOptions extends HttpLink.ContextOptions {
export interface ContextOptions extends BaseBatchHttpLink.ContextOptions, ClientAwarenessLink.ContextOptions {
}
export interface Options extends BatchLink.Shared.Options, HttpLink.Shared.Options {
batchMax?: number;
export interface Options extends BaseBatchHttpLink.Options, ClientAwarenessLink.Options {
}
}

// @public
export class BatchHttpLink extends ApolloLink {
constructor(options?: BatchHttpLink.Options & ClientAwarenessLink.Options);
constructor(options?: BatchHttpLink.Options);
}

// (No @packageDocumentation comment for this package)
Expand Down
6 changes: 2 additions & 4 deletions .api-reports/api-report-link_batch.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import type { Observable } from 'rxjs';

// @public (undocumented)
export namespace BatchLink {
// (undocumented)
export type BatchHandler = (operations: ApolloLink.Operation[], forward: ApolloLink.ForwardFunction[]) => Observable<ApolloLink.Result[]>;
// (undocumented)
export interface Options extends Shared.Options {
batchHandler?: BatchLink.BatchHandler;
batchMax?: number;
Expand All @@ -27,9 +25,9 @@ export namespace BatchLink {
}
}

// @public (undocumented)
// @public
export class BatchLink extends ApolloLink {
constructor(fetchParams?: BatchLink.Options);
constructor(options?: BatchLink.Options);
// (undocumented)
request(operation: ApolloLink.Operation, forward: ApolloLink.ForwardFunction): Observable<ApolloLink.Result>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-link_client-awareness.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export namespace ClientAwarenessLink {
transport?: "headers" | false;
version?: string;
}
export interface ContextOptions {
clientAwareness?: ClientAwarenessLink.ClientAwarenessOptions;
}
// (undocumented)
export interface EnhancedClientAwarenessOptions {
transport?: "extensions" | false;
Expand All @@ -27,7 +30,7 @@ export namespace ClientAwarenessLink {

// @public
export class ClientAwarenessLink extends ApolloLink {
constructor(constructorOptions?: ClientAwarenessLink.Options);
constructor(options?: ClientAwarenessLink.Options);
}

// (No @packageDocumentation comment for this package)
Expand Down
12 changes: 7 additions & 5 deletions .api-reports/api-report-link_context.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ export function setContext(setter: SetContextLink.LegacyContextSetter): SetConte

// @public (undocumented)
export namespace SetContextLink {
export type ContextSetter = (prevContext: Readonly<ApolloLink.OperationContext>, operation: SetContextLink.SetContextOperation) => Promise<Partial<ApolloLink.OperationContext>> | Partial<ApolloLink.OperationContext>;
// @deprecated (undocumented)
export type LegacyContextSetter = (operation: SetContextLink.SetContextOperation, prevContext: Readonly<ApolloLink.OperationContext>) => Promise<Partial<ApolloLink.OperationContext>> | Partial<ApolloLink.OperationContext>;
// (undocumented)
export type ContextSetter = (prevContext: ApolloLink.OperationContext, operation: SetContextOperation) => Promise<Partial<ApolloLink.OperationContext>> | Partial<ApolloLink.OperationContext>;
// (undocumented)
export type LegacyContextSetter = (operation: SetContextOperation, prevContext: ApolloLink.OperationContext) => Promise<Partial<ApolloLink.OperationContext>> | Partial<ApolloLink.OperationContext>;
// (undocumented)
export namespace SetContextLinkDocumentationTypes {
export function ContextSetter(prevContext: Readonly<ApolloLink.OperationContext>, operation: SetContextLink.SetContextOperation): Promise<Partial<ApolloLink.OperationContext>> | Partial<ApolloLink.OperationContext>;
}
export type SetContextOperation = Omit<ApolloLink.Operation, "getContext" | "setContext">;
}

// @public (undocumented)
// @public
export class SetContextLink extends ApolloLink {
constructor(setter: SetContextLink.ContextSetter);
}
Expand Down
116 changes: 62 additions & 54 deletions .api-reports/api-report-link_http.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,67 @@
import { ApolloLink } from '@apollo/client/link';
import type { ASTNode } from 'graphql';
import { ClientAwarenessLink } from '@apollo/client/link/client-awareness';
import type { print as print_2 } from '@apollo/client/utilities';
import type { print as print_2 } from 'graphql';

// @public (undocumented)
export namespace BaseHttpLink {
// (undocumented)
export interface Body {
// (undocumented)
extensions?: Record<string, any>;
// (undocumented)
operationName?: string;
// (undocumented)
query?: string;
// (undocumented)
variables?: Record<string, any>;
}
export interface ContextOptions {
credentials?: RequestCredentials;
fetchOptions?: RequestInit;
headers?: Record<string, string>;
http?: BaseHttpLink.HttpOptions;
uri?: string | BaseHttpLink.UriFunction;
}
export interface HttpOptions {
accept?: string[];
includeExtensions?: boolean;
includeQuery?: boolean;
preserveHeaderCase?: boolean;
}
export interface Options extends Shared.Options {
useGETForQueries?: boolean;
}
// (undocumented)
export type Printer = (node: ASTNode, originalPrint: typeof print_2) => string;
// (undocumented)
export namespace Shared {
export interface Options {
credentials?: RequestCredentials;
fetch?: typeof fetch;
fetchOptions?: RequestInit;
headers?: Record<string, string>;
includeExtensions?: boolean;
includeUnusedVariables?: boolean;
preserveHeaderCase?: boolean;
print?: BaseHttpLink.Printer;
uri?: string | BaseHttpLink.UriFunction;
}
}
// (undocumented)
export type UriFunction = (operation: ApolloLink.Operation) => string;
}

// @public
export class BaseHttpLink extends ApolloLink {
constructor(linkOptions?: HttpLink.Options);
constructor(options?: BaseHttpLink.Options);
}

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

// @public @deprecated (undocumented)
export const createHttpLink: (linkOptions?: HttpLink.Options & ClientAwarenessLink.Options) => HttpLink;
export const createHttpLink: (options?: HttpLink.Options) => HttpLink;

// @public @deprecated (undocumented)
export const createSignalIfSupported: () => {
Expand All @@ -30,11 +79,11 @@ export const createSignalIfSupported: () => {
};

// @public (undocumented)
export const defaultPrinter: HttpLink.Printer;
export const defaultPrinter: BaseHttpLink.Printer;

// @public (undocumented)
export const fallbackHttpConfig: {
http: HttpLink.HttpOptions;
http: BaseHttpLink.HttpOptions;
headers: {
accept: string;
"content-type": string;
Expand All @@ -51,70 +100,29 @@ interface HttpConfig {
// (undocumented)
headers?: Record<string, string>;
// (undocumented)
http?: HttpLink.HttpOptions;
http?: BaseHttpLink.HttpOptions;
// (undocumented)
options?: any;
}

// @public (undocumented)
export namespace HttpLink {
// (undocumented)
export interface Body {
// (undocumented)
extensions?: Record<string, any>;
// (undocumented)
operationName?: string;
// (undocumented)
query?: string;
// (undocumented)
variables?: Record<string, any>;
export interface ContextOptions extends BaseHttpLink.ContextOptions, ClientAwarenessLink.ContextOptions {
}
export interface ContextOptions {
credentials?: RequestCredentials;
fetchOptions?: RequestInit;
headers?: Record<string, string>;
http?: HttpLink.HttpOptions;
uri?: string | HttpLink.UriFunction;
export interface Options extends BaseHttpLink.Options, ClientAwarenessLink.Options {
}
export interface HttpOptions {
accept?: string[];
includeExtensions?: boolean;
includeQuery?: boolean;
preserveHeaderCase?: boolean;
}
export interface Options extends Shared.Options {
useGETForQueries?: boolean;
}
// (undocumented)
export type Printer = (node: ASTNode, originalPrint: typeof print_2) => string;
// (undocumented)
export namespace Shared {
export interface Options {
credentials?: RequestCredentials;
fetch?: typeof fetch;
fetchOptions?: RequestInit;
headers?: Record<string, string>;
includeExtensions?: boolean;
includeUnusedVariables?: boolean;
preserveHeaderCase?: boolean;
print?: HttpLink.Printer;
uri?: string | HttpLink.UriFunction;
}
}
// (undocumented)
export type UriFunction = (operation: ApolloLink.Operation) => string;
}

// @public
export class HttpLink extends ApolloLink {
constructor(options?: HttpLink.Options & ClientAwarenessLink.Options);
constructor(options?: HttpLink.Options);
}

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

// @public (undocumented)
export function rewriteURIForGET(chosenURI: string, body: HttpLink.Body): {
export function rewriteURIForGET(chosenURI: string, body: BaseHttpLink.Body): {
parseError: unknown;
newURI?: undefined;
} | {
Expand All @@ -127,13 +135,13 @@ export function rewriteURIForGET(chosenURI: string, body: HttpLink.Body): {
// @public (undocumented)
export function selectHttpOptionsAndBody(operation: ApolloLink.Operation, fallbackConfig: HttpConfig, ...configs: Array<HttpConfig>): {
options: HttpConfig & Record<string, any>;
body: HttpLink.Body;
body: BaseHttpLink.Body;
};

// @public (undocumented)
export function selectHttpOptionsAndBodyInternal(operation: ApolloLink.Operation, printer: HttpLink.Printer, ...configs: HttpConfig[]): {
export function selectHttpOptionsAndBodyInternal(operation: ApolloLink.Operation, printer: BaseHttpLink.Printer, ...configs: HttpConfig[]): {
options: HttpConfig & Record<string, any>;
body: HttpLink.Body;
body: BaseHttpLink.Body;
};

// @public (undocumented)
Expand Down
25 changes: 5 additions & 20 deletions .api-reports/api-report-link_persisted-queries.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,60 +16,45 @@ export const createPersistedQueryLink: (options: PersistedQueryLink.Options) =>
export namespace PersistedQueryLink {
// (undocumented)
export namespace Base {
// (undocumented)
export interface Options {
// (undocumented)
disable?: (options: PersistedQueryLink.DisableFunctionOptions) => boolean;
// (undocumented)
retry?: (options: PersistedQueryLink.RetryFunctionOptions) => boolean;
// (undocumented)
useGETForHashedQueries?: boolean;
}
}
// (undocumented)
export interface DisableFunctionOptions extends PersistedQueryLink.RetryFunctionOptions {
}
// (undocumented)
export interface ErrorMeta {
// (undocumented)
persistedQueryNotFound: boolean;
// (undocumented)
persistedQueryNotSupported: boolean;
}
// (undocumented)
export type GenerateHashFunction = (document: DocumentNode) => string | PromiseLike<string>;
// (undocumented)
export interface GenerateHashOptions extends Base.Options {
// (undocumented)
generateHash: PersistedQueryLink.GenerateHashFunction;
// (undocumented)
sha256?: never;
}
// (undocumented)
export type Options = PersistedQueryLink.SHA256Options | PersistedQueryLink.GenerateHashOptions;
// (undocumented)
export namespace PersistedQueryLinkDocumentationTypes {
export function GenerateHashFunction(document: DocumentNode): string | PromiseLike<string>;
export function SHA256Function(queryString: string): string | PromiseLike<string>;
}
export interface RetryFunctionOptions {
// (undocumented)
error: ErrorLike;
// (undocumented)
meta: PersistedQueryLink.ErrorMeta;
// (undocumented)
operation: ApolloLink.Operation;
// (undocumented)
result?: FormattedExecutionResult;
}
// (undocumented)
export type SHA256Function = (queryString: string) => string | PromiseLike<string>;
// (undocumented)
export interface SHA256Options extends Base.Options {
// (undocumented)
generateHash?: never;
// (undocumented)
sha256: PersistedQueryLink.SHA256Function;
}
}

// @public (undocumented)
// @public
export class PersistedQueryLink extends ApolloLink {
constructor(options: PersistedQueryLink.Options);
// (undocumented)
Expand Down
7 changes: 2 additions & 5 deletions .api-reports/api-report-link_remove-typename.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,24 @@

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

// @public (undocumented)
// @public
export const KEEP = "__KEEP";

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

// @public (undocumented)
export namespace RemoveTypenameFromVariablesLink {
// (undocumented)
export interface KeepTypenameConfig {
// (undocumented)
[key: string]: typeof KEEP | RemoveTypenameFromVariablesLink.KeepTypenameConfig;
}
// (undocumented)
export interface Options {
// (undocumented)
except?: RemoveTypenameFromVariablesLink.KeepTypenameConfig;
}
}

// @public (undocumented)
// @public
export class RemoveTypenameFromVariablesLink extends ApolloLink {
constructor(options?: RemoveTypenameFromVariablesLink.Options);
}
Expand Down
Loading