As with the back end code, we also need to make adjustments to the Apollo Client configuration before using subscriptions. In Chapter 4, Integrating React into the Back end with Apollo, we set up the Apollo Client with the normal HttpLink. Later, we exchanged it with the createUploadLink function, which enables the user to upload files through GraphQL.
We are going to extend our Apollo Client by using WebSocketLink as well. This allows us to use subscriptions through GraphQL. Both links work side by side. We use the standard HTTP protocol to query data, such as the chat list or the news feed; all of these are real-time updates to keep the UI up to date rely on WebSockets.
To configure the Apollo Client correctly, ...