1.21.0 • Published 1 year ago

graphql-compose-bullmq v1.21.0

Weekly downloads
8
License
MIT
Repository
github
Last release
1 year ago

graphql-compose-bullmq

npm trends travis build Fully automated version management and package publishing

This is a plugin for graphql-compose, which generates GraphQLTypes for bullmq.

Installation

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

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 file. It can be visialized with https://apis.guru/graphql-voyager/ in the following manner:

Queries

Mutations

License

MIT

1.21.0

1 year ago

1.19.0

1 year ago

1.18.0

1 year ago

1.20.0

1 year ago

1.17.1

2 years ago

1.17.0

2 years ago

1.16.0

2 years ago

1.15.2

2 years ago

1.15.1

3 years ago

1.15.0

3 years ago

1.14.0

4 years ago

1.13.1

4 years ago

1.12.3

4 years ago

1.13.0

4 years ago

1.12.2

4 years ago

1.12.1

4 years ago

1.12.0

4 years ago

1.11.0

4 years ago

1.10.0

4 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.1

4 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago