apollo-link

  • Version 1.2.14
  • Published
  • 100 kB
  • 4 dependencies
  • MIT license

Install

npm i apollo-link
yarn add apollo-link
pnpm add apollo-link

Overview

Flexible, lightweight transport layer for GraphQL

Index

Variables

variable makePromise

const makePromise: <R>(observable: Observable<R>) => Promise<R>;

    Functions

    function concat

    concat: (
    first: RequestHandler | ApolloLink,
    second: RequestHandler | ApolloLink
    ) => ApolloLink;

      function createOperation

      createOperation: (starting: any, operation: GraphQLRequest) => Operation;

        function empty

        empty: () => ApolloLink;

          function execute

          execute: (
          link: ApolloLink,
          operation: GraphQLRequest
          ) => Observable<
          FetchResult<{ [key: string]: any }, Record<string, any>, Record<string, any>>
          >;

            function from

            from: (links: ApolloLink[]) => ApolloLink;

              function fromError

              fromError: <T>(errorValue: any) => Observable<T>;

                function fromPromise

                fromPromise: <T>(promise: Promise<T>) => Observable<T>;

                  function split

                  split: (
                  test: (op: Operation) => boolean,
                  left: ApolloLink | RequestHandler,
                  right?: ApolloLink | RequestHandler
                  ) => ApolloLink;

                    function toPromise

                    toPromise: <R>(observable: Observable<R>) => Promise<R>;

                      Classes

                      class ApolloLink {}

                        constructor

                        constructor(request?: RequestHandler);

                          property empty

                          static empty: () => ApolloLink;

                            property execute

                            static execute: (
                            link: ApolloLink,
                            operation: GraphQLRequest
                            ) => Observable<
                            FetchResult<{ [key: string]: any }, Record<string, any>, Record<string, any>>
                            >;

                              property from

                              static from: (links: ApolloLink[]) => ApolloLink;

                                property split

                                static split: (
                                test: (op: Operation) => boolean,
                                left: ApolloLink | RequestHandler,
                                right?: ApolloLink | RequestHandler
                                ) => ApolloLink;

                                  method concat

                                  concat: (next: ApolloLink | RequestHandler) => ApolloLink;

                                    method request

                                    request: (
                                    operation: Operation,
                                    forward?: NextLink
                                    ) => Observable<FetchResult> | null;

                                      method split

                                      split: (
                                      test: (op: Operation) => boolean,
                                      left: ApolloLink | RequestHandler,
                                      right?: ApolloLink | RequestHandler
                                      ) => ApolloLink;

                                        Interfaces

                                        interface ExecutionResult

                                        interface ExecutionResult<
                                        TData = {
                                        [key: string]: any;
                                        }
                                        > extends GraphQLExecutionResult {}

                                          property data

                                          data?: TData | null;

                                            interface GraphQLRequest

                                            interface GraphQLRequest {}

                                              property context

                                              context?: Record<string, any>;

                                                property extensions

                                                extensions?: Record<string, any>;

                                                  property operationName

                                                  operationName?: string;

                                                    property query

                                                    query: DocumentNode;

                                                      property variables

                                                      variables?: Record<string, any>;

                                                        interface Operation

                                                        interface Operation {}

                                                          property extensions

                                                          extensions: Record<string, any>;

                                                            property getContext

                                                            getContext: () => Record<string, any>;

                                                              property operationName

                                                              operationName: string;

                                                                property query

                                                                query: DocumentNode;

                                                                  property setContext

                                                                  setContext: (context: Record<string, any>) => Record<string, any>;

                                                                    property toKey

                                                                    toKey: () => string;

                                                                      property variables

                                                                      variables: Record<string, any>;

                                                                        Type Aliases

                                                                        type FetchResult

                                                                        type FetchResult<
                                                                        TData = {
                                                                        [key: string]: any;
                                                                        },
                                                                        C = Record<string, any>,
                                                                        E = Record<string, any>
                                                                        > = ExecutionResult<TData> & {
                                                                        extensions?: E;
                                                                        context?: C;
                                                                        };
                                                                          type NextLink = (operation: Operation) => Observable<FetchResult>;

                                                                            type RequestHandler

                                                                            type RequestHandler = (
                                                                            operation: Operation,
                                                                            forward: NextLink
                                                                            ) => Observable<FetchResult> | null;

                                                                              Package Files (4)

                                                                              Dependencies (4)

                                                                              Dev Dependencies (11)

                                                                              Peer Dependencies (1)

                                                                              Badge

                                                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/apollo-link.

                                                                              • Markdown
                                                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/apollo-link)
                                                                              • HTML
                                                                                <a href="https://www.jsdocs.io/package/apollo-link"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>