# apollo-link-batch

> Apollo Link that performs batching and operation on batched Operations

Latest version **1.1.15** (published 2020-04-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install apollo-link-batch
pnpm add apollo-link-batch
yarn add apollo-link-batch
bun add apollo-link-batch
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.15 |
| Published | 2020-04-09 |
| First published | 2017-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 75 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1423 |
| Author | Evans Hauser |
| Maintainers | apollo-bot, evanshauser, jbaxleyiii |

## Links

- npm: https://www.npmjs.com/package/apollo-link-batch
- Repository: https://github.com/apollographql/apollo-link
- Homepage: https://github.com/apollographql/apollo-link#readme
- Issues: https://github.com/apollographql/apollo-link/issues
- npm.io page: https://npm.io/package/apollo-link-batch

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^1.9.3
- [apollo-link](https://npm.io/package/apollo-link.md) ^1.2.14

## Recent versions

- 1.1.15 (latest) — 2020-04-09
- 2.0.0-beta.0 (beta) — 2019-11-15
- 1.1.14 — 2019-09-06
- 1.1.13 — 2019-06-14
- 1.1.12 — 2019-03-14
- 1.1.11 — 2019-03-14
- 1.1.10 — 2019-03-05
- 1.1.9 — 2019-02-01
- 1.1.8 — 2019-02-01
- 1.1.7 — 2018-12-15
- 1.1.6 — 2018-12-13
- 1.1.5 — 2018-11-21
- 1.1.4 — 2018-09-15
- 1.1.3 — 2018-04-12
- 1.1.2 — 2018-03-05
- … 20 more at https://npm.io/package/apollo-link-batch/versions

## README

# 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
```js
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|true|

## Context
The Batch Link does not use the context for anything

---
_Source: https://npm.io/package/apollo-link-batch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
