GraphQL subscriptions is a simple npm package that lets you wire up GraphQL with a pubsub system (like Redis) to implement subscriptions in GraphQL. You can use it with any GraphQL client and server (not only Apollo). To begin with GraphQL subscriptions, start by defining a GraphQL Subscription type in your schema. Next, add the Subscription type to your schema definition. Now, let's create a simple PubSub instance - it is a simple pubsub implementation, based on EventEmitter. Alternative EventEmitter implementations can be passed by an options object to the PubSub constructor. Now, implement your Subscriptions type resolver, using the pubsub.asyncIterator to map the event you need. When publishing data to subscribers, we need to make sure that each subscriber gets only the data it needs.

Features

  • Channels Mapping
  • Payload Manipulation
  • Usage with callback listeners
  • Custom AsyncIterator Wrappers
  • PubSub Implementations
  • You can use it with any GraphQL client and server (not only Apollo)

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow graphql-subscriptions

graphql-subscriptions Web Site

Other Useful Business Software
Premier Construction Software Icon
Premier Construction Software

Premier is a global leader in financial construction ERP software.

Rated #1 Construction Accounting Software by Forbes Advisor in 2022 & 2023. Our modern SAAS solution is designed to meet the needs of General Contractors, Developers/Owners, Homebuilders & Specialty Contractors.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of graphql-subscriptions!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript Software Development Software

Registered

2023-03-02