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

Testing - how to mock different responses for same query #9656

Closed
tim-ninan opened this issue May 2, 2022 · 4 comments
Closed

Testing - how to mock different responses for same query #9656

tim-ninan opened this issue May 2, 2022 · 4 comments

Comments

@tim-ninan
Copy link

So I'm trying to do some testing of a certain flow where we hit the same query but at different times during the flow, expecting different results.

My question is, is it possible to provide mock response A for the first time we hit the query, and mock response B for the second time we hit the query? This is with the same query and same variables.

@tim-ninan
Copy link
Author

@benjamn Need some help on this if possible.

@jpvajda
Copy link
Contributor

jpvajda commented Jun 3, 2022

Thank you for reporting this! I suggest posting this in our Apollo Community for guidance from other Apollo users, as other's may have input into your question.

@thiago-soliveira
Copy link

I'm facing this same issue. I don't think this is possible with the current MockedProvider.
Maybe with the new approach this might be possible.

@jpvajda
Copy link
Contributor

jpvajda commented Jun 23, 2022

Relates to: #9738

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants