Back to Apollo Client

Api Report Link Http.Api

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

3.14.14.5 KB
Original Source

API Report File for "@apollo/client"

Do not edit this file. It is a report generated by API Extractor.

ts

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 '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(options?: BaseHttpLink.Options);
}

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

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

// @public @deprecated (undocumented)
export const createSignalIfSupported: () => {
    controller: boolean;
    signal: boolean;
} | {
    controller: AbortController;
    signal: AbortSignal;
};

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

// @public (undocumented)
export const fallbackHttpConfig: {
    http: BaseHttpLink.HttpOptions;
    headers: {
        accept: string;
        "content-type": string;
    };
    options: {
        method: string;
    };
};

// @public (undocumented)
interface HttpConfig {
    // (undocumented)
    credentials?: any;
    // (undocumented)
    headers?: Record<string, string>;
    // (undocumented)
    http?: BaseHttpLink.HttpOptions;
    // (undocumented)
    options?: any;
}

// @public (undocumented)
export namespace HttpLink {
    export interface ContextOptions extends BaseHttpLink.ContextOptions, ClientAwarenessLink.ContextOptions {
    }
    export interface Options extends BaseHttpLink.Options, ClientAwarenessLink.Options {
    }
}

// @public
export class HttpLink extends ApolloLink {
    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: BaseHttpLink.Body): {
    parseError: unknown;
    newURI?: undefined;
} | {
    newURI: string;
    parseError?: undefined;
};

// Warning: (ae-forgotten-export) The symbol "HttpConfig" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export function selectHttpOptionsAndBody(operation: ApolloLink.Operation, fallbackConfig: HttpConfig, ...configs: Array<HttpConfig>): {
    options: HttpConfig & Record<string, any>;
    body: BaseHttpLink.Body;
};

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

// @public (undocumented)
export const selectURI: (operation: ApolloLink.Operation, fallbackURI?: string | ((operation: ApolloLink.Operation) => string)) => any;

// (No @packageDocumentation comment for this package)