apollo-link-http-common

  • Version 0.2.16
  • Published
  • 64.2 kB
  • 3 dependencies
  • MIT license

Install

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

Overview

Http utilities for Apollo Link shared across all links using http

Index

Variables

variable fallbackHttpConfig

const fallbackHttpConfig: {
http: HttpQueryOptions;
headers: { accept: string; 'content-type': string };
options: { method: string };
};

    Functions

    function checkFetcher

    checkFetcher: (
    fetcher: (input: RequestInfo, init?: RequestInit) => Promise<Response>
    ) => void;

      function createSignalIfSupported

      createSignalIfSupported: () => { controller: any; signal: any };

        function parseAndCheckHttpResponse

        parseAndCheckHttpResponse: (
        operations: any
        ) => (response: Response) => Promise<any>;

          function selectHttpOptionsAndBody

          selectHttpOptionsAndBody: (
          operation: any,
          fallbackConfig: HttpConfig,
          ...configs: HttpConfig[]
          ) => { options: HttpConfig & Record<string, any>; body: Body };

            function selectURI

            selectURI: (
            operation: any,
            fallbackURI?: string | ((operation: any) => string)
            ) => any;

              function serializeFetchParameter

              serializeFetchParameter: (p: any, label: any) => any;

                function throwServerError

                throwServerError: (response: any, result: any, message: any) => never;

                  Interfaces

                  interface Body

                  interface Body {}

                    property extensions

                    extensions?: Record<string, any>;

                      property operationName

                      operationName?: string;

                        property query

                        query?: string;

                          property variables

                          variables?: Record<string, any>;

                            interface HttpConfig

                            interface HttpConfig {}

                              property credentials

                              credentials?: any;

                                property headers

                                headers?: any;

                                  property http

                                  http?: HttpQueryOptions;

                                    property options

                                    options?: any;

                                      interface HttpOptions

                                      interface HttpOptions {}

                                        property credentials

                                        credentials?: string;

                                          property fetch

                                          fetch?: WindowOrWorkerGlobalScope['fetch'];

                                            property fetchOptions

                                            fetchOptions?: any;

                                              property headers

                                              headers?: any;

                                                property includeExtensions

                                                includeExtensions?: boolean;

                                                  property uri

                                                  uri?: string | UriFunction;

                                                    interface HttpQueryOptions

                                                    interface HttpQueryOptions {}

                                                      property includeExtensions

                                                      includeExtensions?: boolean;

                                                        property includeQuery

                                                        includeQuery?: boolean;

                                                          interface UriFunction

                                                          interface UriFunction {}

                                                            call signature

                                                            (operation: Operation): string;

                                                              Type Aliases

                                                              type ClientParseError

                                                              type ClientParseError = InvariantError & {
                                                              parseError: Error;
                                                              };

                                                                type ServerError

                                                                type ServerError = Error & {
                                                                response: Response;
                                                                result: Record<string, any>;
                                                                statusCode: number;
                                                                };

                                                                  type ServerParseError

                                                                  type ServerParseError = Error & {
                                                                  response: Response;
                                                                  statusCode: number;
                                                                  bodyText: string;
                                                                  };

                                                                    Package Files (1)

                                                                    Dependencies (3)

                                                                    Dev Dependencies (12)

                                                                    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-http-common.

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