mock-socket
mock-socket copied to clipboard
How to mock Apollo client to test graphql subscription
Does it work with apollo client? I'm trying to create mock client in cypress to graphql subscription, but apollo use ‘WebSocketLink’ instead of ‘WebSocket’ so it did not work. How can I use it with cypress and graphql?
According to their documentation, you can provide a WebSocketImpl class if you don't want to use native one https://www.apollographql.com/docs/react/api/link/apollo-link-ws/#options