# apollo-link-combine-includes

> Apollo Link that performs merging of same-operation requests

Latest version **0.2.1** (published 2018-10-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install apollo-link-combine-includes
pnpm add apollo-link-combine-includes
yarn add apollo-link-combine-includes
bun add apollo-link-combine-includes
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2018-10-10 |
| First published | 2018-10-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 90.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Lucas Constantino Silva |
| Maintainers | lucasconstantino |
| Keywords | graphql, apollo link, apollo |

## Links

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

## Dependencies (2)

- [apollo-link](https://npm.io/package/apollo-link.md) ^1.2.3
- [apollo-link-batch](https://npm.io/package/apollo-link-batch.md) ^1.1.4

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 0.2.1 (latest) — 2018-10-10
- 0.1.0 — 2018-10-10

## README

# Combine Includes Link

[![Build Status](https://travis-ci.org/lucasconstantino/apollo-link-combine-includes.svg?branch=master)](https://travis-ci.org/lucasconstantino/apollo-link-combine-includes)
[![coverage](https://img.shields.io/codecov/c/github/lucasconstantino/graphql-resolvers.svg?style=flat-square)](https://codecov.io/github/lucasconstantino/apollo-link-combine-includes)
[![npm version](https://img.shields.io/npm/v/apollo-link-combine-includes.svg?style=flat-square)](https://www.npmjs.com/package/apollo-link-combine-includes)
[![sponsored by Taller](https://raw.githubusercontent.com/TallerWebSolutions/tallerwebsolutions.github.io/master/sponsored-by-taller.png)](https://taller.net.br/en/)

## ⚠️ Be careful

This project is a crazy experiment, did work with a quite complicated scenario, but is honestly not
yet stressed enough to consider it not error prone, or even stable.

## Purpose

An Apollo Link that combines multiple same-query requests using different
include/skip directives into a single query.

## Installation

`npm install apollo-link-combine-includes --save`

## Usage

```js
import { CombineIncludesLink } from 'apollo-link-combine-includes'

const link = new CombineIncludesLink()
```

## 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    |
| canCombine    | (operation: Operation, defaultCanCombine: function) => Boolean | Operation has a name and include directives | false    |

## Context

The CombineIncludesLink does not use the context for anything

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