In Subscriptions - Apollo GraphQL Docs , the Apollo doc indicates that “Although Apollo Client can use your GraphQLWsLink to execute all operation types, in most cases it should continue using HTTP for queries and mutations.”
To help me understand this better, what are the cases in which the WebSocket connection should be used to execute queries and mutations? For example, if a persistent WS connection can be assumed, would bandwagoning onto it make sense?
The example code underneath the doc also shows the ability to conditionally choose HTTP or WS depending on the operation and type, but it does so somewhat statically; can this be done dynamically (ie, if a websocket connection already exists, to bandwagon onto it)? I may be missing something basic here, but why wouldn’t it use the WS connection if it could confirm that it already exists? Are there any unforeseen downsides with this method? Thanks!