Socket
Socket
Sign inDemoInstall

graphql-compose-bullmq

Package Overview
Dependencies
42
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    graphql-compose-bullmq

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


Version published
Weekly downloads
2
decreased by-84.62%
Maintainers
1
Install size
353 kB
Created
Weekly downloads
 

Readme

Source

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

Screen Shot 2020-04-14 at 21 22 38

Mutations

Screen Shot 2020-04-14 at 21 24 05

License

MIT

Keywords

FAQs

Last updated on 27 Oct 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc