react-apollo icon indicating copy to clipboard operation
react-apollo copied to clipboard

remove @client in query breaks specs

Open winterlamon opened this issue 7 years ago • 3 comments

Intended outcome:

Tests pass.

Actual outcome:

Tests fail with No more mocked responses for the query error.

How to reproduce the issue:

Passing in a mock query in specs with MockProvider that includes @client like this:

const GET_SOMETHING = `
     query {
          id
          someValue @client
     }

will return a No more mocked responses for the query error since the mock does not match the pattern expected because the @client (in this case someValue) gets stripped from the query by this:

https://github.com/apollographql/react-apollo/blob/051f179744655227c74765ba68a71db6f0b87be2/src/test-links.ts#L126

Version

winterlamon avatar Apr 17 '19 20:04 winterlamon

we are using apollo-link-state here. Not sure if that makes a difference.

quinn avatar Apr 18 '19 17:04 quinn

same issue here @hwillson

maamounapprise avatar Jun 03 '19 19:06 maamounapprise

React Apollo has been refactored to use React Hooks behind the scenes for everything, which means a lot has changed since this issue was opened (and a lot of outstanding issues have been resolved). We'll close this issue off, but please let us know if you're still encountering this problem using React Apollo >= 3.1.0. Thanks!

hwillson avatar Sep 06 '19 11:09 hwillson