In this section, I'll quickly guide you through the second use case for subscriptions. Showing notifications to a user are traditional events that a user should see as you know from Facebook. Instead of relying on the subscribeToMore function, we use the Subscription component that's provided by Apollo. This component works like the Query and Mutation components, but for subscriptions.
Follow these steps to get your first Subscription component running:
- Create a subscriptions folder inside the client's components folder. You can save all subscriptions that you implement using Apollo's Subscription component inside this folder.
- Insert a messageAdded.js file into the folder and paste in the following ...