apollo-link-batch
TypeScript icon, indicating that this package has built-in type declarations

1.1.15 • Public • Published

Batch Link

Purpose

An Apollo Link to allow batching of multiple operations into a single request. For example, the apollo-link-batch-http uses this link to batch operations into a single http request.

Installation

npm install apollo-link-batch --save

Usage

import { BatchLink } from "apollo-link-batch";
 
const link = new BatchLink({
  batchHandler: (operations: Operation[], forward: NextLink) => Observable<FetchResult[]> | null
});

Options

Batch Link takes an object with three options on it to customize the behavior of the link. The only required option is the batchHandler function

name value default required
batchInterval number 10 false
batchMax number 0 false
batchHandler (operations: Operation[], forward: NextLink) => Observable<FetchResult[]> null NA

Context

The Batch Link does not use the context for anything

Readme

Keywords

none

Package Sidebar

Install

npm i apollo-link-batch

Weekly Downloads

28,471

Version

1.1.15

License

MIT

Unpacked Size

76.8 kB

Total Files

22

Last publish

Collaborators

  • jbaxleyiii
  • apollo-bot