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

Improve 'No more mocked responses' error message #6963

Closed
wants to merge 3 commits into from
Closed

Improve 'No more mocked responses' error message #6963

wants to merge 3 commits into from

Conversation

Msordet
Copy link

@Msordet Msordet commented Sep 2, 2020

Improves the error message when no more mocked responses are found.

2nd commit addressing: #6771

Example from tests:

Error: No more mocked responses for the query: query GetUser($username: String!) {
  user(username: $username) {
    id
    __typename
  }
}

Expected variables:
  {"username":"mock_username","age":"undefined"}
Found 1 mock with variables:
  1: {"username":"mock_username"}
Error: No more mocked responses for the query: query GetUser($username: String!) {
  user(username: $username) {
    id
    __typename
  }
}

Expected variables:
  {"username":"some_user","age":42}
Found 1 mock with variables:
  1: {"age":13,"username":"some_user"}
Error: No more mocked responses for the query: query GetUser($username: String!) {
  user(username: $username) {
    id
    __typename
  }
}

Expected variables:
  {"username":"mock_username"}

Checklist:

  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests

@apollo-cla
Copy link

@Msordet: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@lbartroli
Copy link

@Msordet what's the status of this?

@AnasMostefaoui
Copy link

Thank you for this suggestion it will help a lot figuring out the mismatch. is there any update on this PR ?

@dannycochran
Copy link
Contributor

@benjamn anyway you can help bring this home? seems like some simple merge conflicts.

it's pretty tricky to debug mock mismatching at the moment.

@benjamn
Copy link
Member

benjamn commented Jun 8, 2021

@dannycochran These changes should be available now in @apollo/client@3.4.0-rc.6, thanks to @markneub's PR #8340. Thanks for bringing this PR back to our attention.

@benjamn benjamn closed this Jun 8, 2021
@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.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants