Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to mock Apollo client to test graphql subscription #345

Open
Ofrishani opened this issue Dec 1, 2021 · 1 comment
Open

How to mock Apollo client to test graphql subscription #345

Ofrishani opened this issue Dec 1, 2021 · 1 comment

Comments

@Ofrishani
Copy link

Ofrishani commented Dec 1, 2021

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?

@Ofrishani Ofrishani changed the title How to mock Apollo server to test graphql subscription How to mock Apollo client to test graphql subscription Dec 1, 2021
@Atrue
Copy link
Collaborator

Atrue commented Dec 6, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants