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

You Might Also Like
Top-Rated Free CRM Software Icon
Top-Rated Free CRM Software

216,000+ customers in over 135 countries grow their businesses with HubSpot

HubSpot is an AI-powered customer platform with all the software, integrations, and resources you need to connect your marketing, sales, and customer service. HubSpot's connected platform enables you to grow your business faster by focusing on what matters most: your customers.
Get started free
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