apollo-fetch

  • Version 0.7.0
  • Published
  • 1 dependency
  • MIT license

Install

npm i apollo-fetch
yarn add apollo-fetch
pnpm add apollo-fetch

Overview

Lightweight implementation of fetch for GraphQL requests

Index

Functions

function constructDefaultOptions

constructDefaultOptions: (
requestOrRequests: GraphQLRequest | GraphQLRequest[],
options: RequestInit
) => RequestInit;

    function createApolloFetch

    createApolloFetch: (params?: FetchOptions) => ApolloFetch;

      Interfaces

      interface ApolloFetch

      interface ApolloFetch {}

        property batchUse

        batchUse: (middlewares: BatchMiddlewareInterface) => ApolloFetch;

          property batchUseAfter

          batchUseAfter: (afterwares: BatchAfterwareInterface) => ApolloFetch;

            property use

            use: (middlewares: MiddlewareInterface) => ApolloFetch;

              property useAfter

              useAfter: (afterwares: AfterwareInterface) => ApolloFetch;

                call signature

                (operation: GraphQLRequest): Promise<FetchResult>;

                  call signature

                  (operation: GraphQLRequest[]): Promise<FetchResult[]>;

                    interface BatchError

                    interface BatchError extends Error {}

                      property response

                      response: ParsedResponse;

                        interface FetchError

                        interface FetchError extends Error {}

                          property parseError

                          parseError?: Error;

                            property response

                            response: ParsedResponse;

                              interface FetchOptions

                              interface FetchOptions {}

                                property constructOptions

                                constructOptions?: (
                                requestOrRequests: GraphQLRequest | GraphQLRequest[],
                                options: RequestInit
                                ) => RequestInit;

                                  property customFetch

                                  customFetch?: (request: RequestInfo, init: RequestInit) => Promise<Response>;

                                    property uri

                                    uri?: string;

                                      interface FetchResult

                                      interface FetchResult {}

                                        property data

                                        data: any;

                                          property errors

                                          errors?: any;

                                            property extensions

                                            extensions?: any;

                                              interface GraphQLRequest

                                              interface GraphQLRequest {}

                                                property operationName

                                                operationName?: string;

                                                  property query

                                                  query?: string;

                                                    property variables

                                                    variables?: object;

                                                      interface ParsedResponse

                                                      interface ParsedResponse extends Response {}

                                                        property parsed

                                                        parsed?: any;

                                                          property raw

                                                          raw: string;

                                                            interface RequestAndOptions

                                                            interface RequestAndOptions {}

                                                              property options

                                                              options: RequestInit;

                                                                property request

                                                                request: GraphQLRequest;

                                                                  interface RequestsAndOptions

                                                                  interface RequestsAndOptions {}

                                                                    property options

                                                                    options: RequestInit;

                                                                      property requests

                                                                      requests: GraphQLRequest[];

                                                                        interface ResponseAndOptions

                                                                        interface ResponseAndOptions {}

                                                                          property options

                                                                          options: RequestInit;

                                                                            property response

                                                                            response: ParsedResponse;

                                                                              Type Aliases

                                                                              type AfterwareInterface

                                                                              type AfterwareInterface = (response: ResponseAndOptions, next: Function) => void;

                                                                                type BatchAfterwareInterface

                                                                                type BatchAfterwareInterface = (
                                                                                response: ResponseAndOptions,
                                                                                next: Function
                                                                                ) => void;

                                                                                  type BatchMiddlewareInterface

                                                                                  type BatchMiddlewareInterface = (
                                                                                  requests: RequestsAndOptions,
                                                                                  next: Function
                                                                                  ) => void;

                                                                                    type MiddlewareInterface

                                                                                    type MiddlewareInterface = (request: RequestAndOptions, next: Function) => void;

                                                                                      Package Files (3)

                                                                                      Dependencies (1)

                                                                                      Dev Dependencies (18)

                                                                                      Peer Dependencies (0)

                                                                                      No peer dependencies.

                                                                                      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-fetch.

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