https://github.com/graphql-compose/graphql-compose-bullmq
https://github.com/graphql-compose/graphql-compose-bullmq
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/graphql-compose/graphql-compose-bullmq
- Owner: graphql-compose
- License: mit
- Created: 2020-04-01T14:19:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-27T08:00:17.000Z (about 2 years ago)
- Last Synced: 2025-06-01T08:13:43.024Z (7 months ago)
- Language: TypeScript
- Size: 944 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# graphql-compose-bullmq
[](https://www.npmjs.com/package/graphql-compose-bullmq)
[](http://www.npmtrends.com/graphql-compose-bullmq)
[](https://travis-ci.org/graphql-compose/graphql-compose-bullmq)
[](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 in the following manner:
### Queries

### Mutations

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