# graphql-compose-bullmq

> This is a plugin for `graphql-compose`, which generates GraphQLTypes for BullMQ.

Latest version **1.21.0** (published 2023-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install graphql-compose-bullmq
pnpm add graphql-compose-bullmq
yarn add graphql-compose-bullmq
bun add graphql-compose-bullmq
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.21.0 |
| Published | 2023-10-27 |
| First published | 2020-04-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 353.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Maintainers | nodkz |
| Keywords | graphql, compose, bull, bullmq, job, redis |

## Links

- npm: https://www.npmjs.com/package/graphql-compose-bullmq
- Repository: https://github.com/graphql-compose/graphql-compose-bullmq
- Issues: https://github.com/graphql-compose/graphql-compose-bullmq/issues
- npm.io page: https://npm.io/package/graphql-compose-bullmq

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.21.0 (latest) — 2023-10-27
- 1.20.0 — 2023-08-24
- 1.19.0 — 2023-08-24
- 1.18.0 — 2023-08-21
- 1.17.1 — 2023-05-03
- 1.17.0 — 2023-04-26
- 1.16.0 — 2023-04-25
- 1.15.2 — 2022-06-29
- 1.15.1 — 2021-08-26
- 1.15.0 — 2021-05-30
- 1.14.0 — 2021-04-30
- 1.13.1 — 2021-03-26
- 1.13.0 — 2021-02-16
- 1.12.3 — 2021-02-16
- 1.12.2 — 2020-09-10
- … 20 more at https://npm.io/package/graphql-compose-bullmq/versions

## README

# graphql-compose-bullmq

[![npm](https://img.shields.io/npm/v/graphql-compose-bullmq.svg)](https://www.npmjs.com/package/graphql-compose-bullmq)
[![trends](https://img.shields.io/npm/dt/graphql-compose-bullmq.svg)](http://www.npmtrends.com/graphql-compose-bullmq)
[![travis build](https://img.shields.io/travis/graphql-compose/graphql-compose-bullmq.svg)](https://travis-ci.org/graphql-compose/graphql-compose-bullmq)
[![Fully automated version management and package publishing](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

This is a plugin for [graphql-compose](https://github.com/graphql-compose/graphql-compose), which generates GraphQLTypes for [bullmq](https://github.com/taskforcesh/bullmq).

## Installation

```bash
npm install graphql graphql-compose bullmq graphql-compose-bullmq --save
```

Modules `graphql`, `graphql-compose`, `bullmq` are in `peerDependencies`, so should be installed explicitly in your app. They have global objects and should not have ability to be installed as submodule.

## Example

```js
import { composeBull } from 'graphql-compose-bullmq';
import { schemaComposer } from 'graphql-compose';

const { queryFields, mutationFields } = composeBull({
  schemaComposer,
  typePrefix: 'Prefix',
  jobDataTC: `type MyJobData { fieldA: String! fieldB: String}`,
  queue: {
    name: 'fetch_metrics',
    prefix: 'bull.demo',
  },
  redis: 'redis://127.0.0.1:6379',
});

schemaComposer.Query.addFields({
  ...queryFields,
  // Will provide the following fields:
  //   queueKeys
  //   queues
  //   queue
  //   job
});

schemaComposer.Mutation.addFields({
  ...mutationFields,
  // Will provide the following fields:
  //   queueClean
  //   queueDrain
  //   queuePause
  //   queueResume
  //   queueRemoveRepeatable
  //   jobAdd
  //   jobAddBulk
  //   jobAddRepeatableCron
  //   jobAddRepeatableEvery
  //   jobDiscard
  //   jobPromote
  //   jobRemove
  //   jobRetry
  //   jobUpdate
  //   jobLogAdd
});

const schema = schemaComposer.buildSchema();
```

## Schema

`composeBull` will generate particles for your further schema. It contains more than 40 types wich helps to you work with Bull Queues. You may see generated files in [schema.graphql](./example/schema.graphql) file. It can be visialized with <https://apis.guru/graphql-voyager/> in the following manner:

### Queries

<img width="1323" alt="Screen Shot 2020-04-14 at 21 22 38" src="https://user-images.githubusercontent.com/1946920/79242603-5ab18900-7e96-11ea-8aad-7aff95e285ba.png">

### Mutations

<img width="1327" alt="Screen Shot 2020-04-14 at 21 24 05" src="https://user-images.githubusercontent.com/1946920/79242633-61d89700-7e96-11ea-9efc-3afadc3e082c.png">

## License

[MIT](https://github.com/graphql-compose/graphql-compose-bullmq/blob/master/LICENSE.md)

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