Files
cats.subscriptions.spec.tsread-only
Read-only: these tests are the lesson's contract. Make them pass by changing the code they test.
What you'll learn
- Explain subscriptions: a long-lived operation that receives an event each time the server publishes one, usually over WebSockets
- Publish events with a PubSub injected as a provider, and subscribe to them with @Subscription() returning its async iterator
- Deliver an event only to the subscribers who want it with a filter over the payload and the subscription's variables
- Shape what subscribers receive with resolve, and test subscriptions through the schema with graphql's subscribe()
Press Run tests to start the app. Its log appears here.Tests
- test/cats.subscriptions.spec.tsrun to see its tests