Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
src chore: prune-low-hanging fruit in apollo-link-batch Mar 5, 2019
.npmignore Add .rpt2_cache to all packages/*/.npmignore files. (#972) Mar 5, 2019
CHANGELOG.md Deprecate individual package changelogs; Placehold root log (#879) Nov 29, 2018
README.md
package.json chore(deps): update dependency rollup to v1.12.3 May 20, 2019
rollup.config.js Same rollup config, same naming convention (#246) Nov 15, 2017
tsconfig.json bring repo to pairity with apollo-client and remove soon to be dead p… Oct 2, 2017

README.md

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

You can’t perform that action at this time.