Company
Date Published
Author
Shadaj Laddad
Word count
1471
Language
English
Hacker News points
None

Summary

This tutorial guides developers through implementing server-side GraphQL subscriptions using the `graphql-subscriptions` package. The tutorial starts by setting up a basic client and server, and then adds a subscription to notify clients of new messages in a channel. It covers the process of adding a subscription resolver, publishing events to an in-memory pub/sub object, and resolving subscription queries. Finally, it sets up a WebSocket transport for subscriptions using the `subscriptions-transport-ws` package, allowing the server to push updates to the client in near real-time. The tutorial concludes by highlighting the implementation of server-side GraphQL subscriptions and encouraging developers to learn more about Apollo and GraphQL.