Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

@apollo/react-testing raising 'Network error: No more mocked responses for the query: query getProduct...' #3481

Closed
maapteh opened this issue Sep 10, 2019 · 1 comment

Comments

@maapteh
Copy link
Contributor

maapteh commented Sep 10, 2019

Intended outcome:
The mocked provider should pass its mocked data

Actual outcome:
Error: No more mocked responses for the query: query getProduct($id: String!)

How to reproduce the issue:
My code is the following: https://gist.github.com/maapteh/70892c99791cdac385f3d5e00de405de

You can see the loading state is going from true into false. But in that stage i have no data. The console then shows me the actual outcome. The variables are tested too and correct. I tested with __typename's in the response and without but nothing made the error go away...

Version

  System:
    OS: macOS 10.14.5
  Binaries:
    Node: 10.16.3 - ~/.nvm/versions/node/v10.16.3/bin/node
    Yarn: 1.17.3 - ~/Git/graphql-modules-app/packages/app/node_modules/.bin/yarn
    npm: 6.9.0 - ~/.nvm/versions/node/v10.16.3/bin/npm
  Browsers:
    Chrome: 76.0.3809.132
    Safari: 12.1.1
  npmPackages:
    apollo: 2.18.1 => 2.18.1
    apollo-cache-inmemory: ^1.5.1 => 1.6.3
    apollo-client: ^2.6.4 => 2.6.4
    apollo-link: ^1.2.8 => 1.2.12
    apollo-link-batch-http: ^1.2.8 => 1.2.12
    apollo-link-error: ^1.1.7 => 1.1.11
    apollo-link-http: ^1.5.11 => 1.5.15
    apollo-utilities: ^1.3.2 => 1.3.2
    @testing-library/react: ^9.1.4 => 9.1.4
    @testing-library/react-hooks: ^2.0.1 => 2.0.1
  npmGlobalPackages:
    apollo: 2.18.0
@maapteh
Copy link
Contributor Author

maapteh commented Sep 10, 2019

as usual it was my own mistake :) the fragment was not correctly set and types should be added

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

No branches or pull requests

1 participant