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
Fully Managed MySQL, PostgreSQL, and SQL Server Icon
Fully Managed MySQL, PostgreSQL, and SQL Server

Automatic backups, patching, replication, and failover. Focus on your app, not your database.

Cloud SQL handles your database ops end to end, so you can focus on your app.
Try 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