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

REACT-NATIVE: Invariant Violation: Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql, js engine: hermes

Open adembacajmemmo opened this issue 3 years ago • 3 comments
trafficstars

Hello everyone, after migrating from Apollo-Client V2 to V3, I am not able to work on debug more anymore. IF I run the app it will work normally as it was working until I do any change in any project file. Each time I save anything from the project, it will crash with the error below

Intended outcome:

After migrating from Apollo-Client V2 to Apollo-Client V3, everytime I save anything on my project file, it will crash the app, and will throw this message:

Invariant Violation: Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql, js engine: hermes

Actual outcome:

It should work normally without any issue. I am using gql from @apollo/client library How to reproduce the issue:

Versions

adembacajmemmo avatar Jun 22 '22 13:06 adembacajmemmo

@adembacajmemmo 👋 could you run the following command in your project directory, and paste its (automatically copied to clipboard) results here:

npx envinfo@latest --preset apollo --clipboard

jpvajda avatar Jun 23 '22 18:06 jpvajda

@jpvajda yes of course, here it is.

System: OS: macOS 12.1 Binaries: Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node Yarn: 1.22.18 - /opt/homebrew/bin/yarn npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm Browsers: Chrome: 103.0.5060.53 Edge: 103.0.1264.37 Firefox: 99.0.1 Safari: 15.2 npmPackages: @apollo/client: ^3.6.6 => 3.6.6 apollo-link-logger: ^2.0.0 => 2.0.0 apollo3-cache-persist: ^0.14.0 => 0.14.0 react-apollo-network-status: ^5.0.0 => 5.0.0

adembacajmemmo avatar Jun 23 '22 20:06 adembacajmemmo

@jpvajda After downgrading to 3.4.17, I can not reproduce this issue anymore, but immediately after upgrading to 3.5.x or bigger version, I am facing this issue.

adembacajmemmo avatar Jun 25 '22 14:06 adembacajmemmo

any updates to this?

vinaygupta98 avatar Nov 02 '22 12:11 vinaygupta98

@vinaygupta98 are you also experience this issue? If so do you mind running this command and replying with the output?

npx envinfo@latest --preset apollo --clipboard

jpvajda avatar Nov 02 '22 15:11 jpvajda

Thanks for your patience folks, could someone share some code snippets so we can help narrow down the issue here? I'm also wondering whether the behavior is the same if you remove react-apollo-network-status from the link chain?

bignimbus avatar Feb 14 '23 04:02 bignimbus

We're closing this issue now but feel free to ping the maintainers or open a new issue if you still need support. Thank you!

github-actions[bot] avatar Mar 16 '23 05:03 github-actions[bot]

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. For general questions, we recommend using StackOverflow or our discord server.

github-actions[bot] avatar Apr 16 '23 00:04 github-actions[bot]