Subscription at frontend for Rails Action Cable socket server

Hi guys, our server use Rails Action Cable and I have followed this doc Subscriptions - Apollo GraphQL Docs to connect to our socket but it doesn’t work. The error message is in this screenshot. Before it failed, Socket had been closed

I also attempt to connect with graphql-ws but it seems that the library requires same protocal between server and client and the server is not under my control.
My question is Is it possible to connect Rails Action Cable socket server with Apollo client or do I have to turn to other alternative?
Thank you very much guys!

For anyone who might encounter this issue in the future. We neither use graphql-ws nor subscriptions-transport-ws. Rails Action Cable seems to work well with graphql-ruby-client for us. Pls visit its documentation if you get stucked.

I speculate that this has something todo with matching protocol but I might be wrong. It would be lovely if someone can dig into this. Hope this helps! Have a great day!