apollo-client
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
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 👋 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 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
@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.
any updates to this?
@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
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?
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!
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.