Back to Apollo Client

Api Report Link.Api

.api-reports/api-report-link.api.md

3.14.14.8 KB
Original Source

API Report File for "@apollo/client"

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

ts

import type { ApolloClient } from '@apollo/client';
import type { ApplyHKTImplementationWithDefault } from '@apollo/client/utilities/internal';
import type { DefaultContext } from '@apollo/client';
import { DocumentNode } from 'graphql';
import type { FormattedExecutionResult } from 'graphql';
import type { GraphQLFormattedError } from 'graphql';
import type { NotImplementedHandler } from '@apollo/client/incremental';
import type { Observable } from 'rxjs';
import type { OperationTypeNode } from 'graphql';
import type { OperationVariables } from '@apollo/client';
import type { TypeOverrides } from '@apollo/client';

// @public (undocumented)
export namespace ApolloLink {
    // (undocumented)
    export type AdditionalResultTypes<TData = Record<string, any>, TExtensions = Record<string, any>> = ApplyHKTImplementationWithDefault<TypeOverrides, "AdditionalApolloLinkResultTypes", NotImplementedHandler.TypeOverrides, TData, TExtensions>;
    // (undocumented)
    export namespace DocumentationTypes {
        export function ForwardFunction(operation: ApolloLink.Operation): Observable<ApolloLink.Result>;
        export function RequestHandler(operation: ApolloLink.Operation, forward: ApolloLink.ForwardFunction): Observable<ApolloLink.Result>;
    }
    export interface ExecuteContext {
        client: ApolloClient;
    }
    export type ForwardFunction = (operation: ApolloLink.Operation) => Observable<ApolloLink.Result>;
    export interface Operation {
        readonly client: ApolloClient;
        extensions: Record<string, any>;
        getContext: () => Readonly<ApolloLink.OperationContext>;
        operationName: string | undefined;
        operationType: OperationTypeNode;
        query: DocumentNode;
        setContext: {
            (context: Partial<ApolloLink.OperationContext>): void;
            (updateContext: (previousContext: Readonly<ApolloLink.OperationContext>) => Partial<ApolloLink.OperationContext>): void;
        };
        variables: OperationVariables;
    }
    export interface OperationContext extends DefaultContext {
    }
    export interface Request {
        context?: DefaultContext;
        extensions?: Record<string, any>;
        query: DocumentNode;
        variables?: OperationVariables;
    }
    export type RequestHandler = (operation: ApolloLink.Operation, forward: ApolloLink.ForwardFunction) => Observable<ApolloLink.Result>;
    // (undocumented)
    export type Result<TData = Record<string, any>, TExtensions = Record<string, any>> = FormattedExecutionResult<TData, TExtensions> | AdditionalResultTypes<TData, TExtensions>;
}

// @public
export class ApolloLink {
    constructor(request?: ApolloLink.RequestHandler);
    // @deprecated
    static concat(...links: ApolloLink[]): ApolloLink;
    concat(...links: ApolloLink[]): ApolloLink;
    static empty(): ApolloLink;
    static execute(link: ApolloLink, request: ApolloLink.Request, context: ApolloLink.ExecuteContext): Observable<ApolloLink.Result>;
    static from(links: ApolloLink[]): ApolloLink;
    // @internal @deprecated
    getMemoryInternals?: () => unknown;
    // @internal @deprecated
    readonly left?: ApolloLink;
    request(operation: ApolloLink.Operation, forward: ApolloLink.ForwardFunction): Observable<ApolloLink.Result>;
    // @internal @deprecated
    readonly right?: ApolloLink;
    static split(test: (op: ApolloLink.Operation) => boolean, left: ApolloLink, right?: ApolloLink): ApolloLink;
    split(test: (op: ApolloLink.Operation) => boolean, left: ApolloLink, right?: ApolloLink): ApolloLink;
}

// @public (undocumented)
export interface ApolloPayloadResult<TData = Record<string, any>, TExtensions = Record<string, any>> {
    // (undocumented)
    errors?: ReadonlyArray<GraphQLFormattedError>;
    // (undocumented)
    payload: FormattedExecutionResult<TData, TExtensions> | null;
}

// @public @deprecated (undocumented)
export const concat: typeof ApolloLink.concat;

export { DocumentNode }

// @public @deprecated (undocumented)
export const empty: typeof ApolloLink.empty;

// @public (undocumented)
export const execute: typeof ApolloLink.execute;

// @public @deprecated (undocumented)
export type FetchResult<TData = Record<string, any>, TExtensions = Record<string, any>> = ApolloLink.Result<TData, TExtensions>;

// @public @deprecated (undocumented)
export const from: typeof ApolloLink.from;

// @public @deprecated (undocumented)
export type GraphQLRequest = ApolloLink.Request;

// @public @deprecated (undocumented)
export type Operation = ApolloLink.Operation;

// @public @deprecated (undocumented)
export type RequestHandler = ApolloLink.RequestHandler;

// @public @deprecated (undocumented)
export const split: typeof ApolloLink.split;

// (No @packageDocumentation comment for this package)