-
Notifications
You must be signed in to change notification settings - Fork 177
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
TypeError: graphql.parse is not a function (it is undefined), js engine: hermes #814
Comments
Hey @oreoluwadnd 👋 Can you share more about what you're doing? Its difficult to tell whats happening without seeing how you're using |
Hi @jerelmiller. In my React Native app, I have set up Apollo Client to handle GraphQL queries and mutations. Here's a bit more detail about my implementation. Setup: I've installed the necessary packages using yarn, including @apollo/client version 3.3.19 for Apollo Client and graphql version 16.8.1 for working with GraphQL queries.
Using gql: In my components or other parts of the app, I import gql from @apollo/client to define GraphQL queries and mutations. Here's an example of how I'm using gql:
This is where I encounter the error with graphql.parse. It seems to be related to how gql is used, but I'm not sure what might be causing it. If there's any specific part of my implementation, you'd like more details on, or if you have any other questions, please let me know. I appreciate your help! |
Hmmm interesting. Nothing you posted here sticks out to me as problematic. We definitely have users of React Native that are using Apollo Client, so its possible there is something happening with your build environment? I'd be curious if simply upgrading Apollo Client fixes your issue. We just released 3.10.1. It looks like 3.3.19 was released in May 2021, so its almost 3 years old. There have been a ton of fixes and build optimizations since the version you're working with, especially on the React Native side, so there is a chance this might help on its own. If that doesn't work, you might try the troubleshooting steps from this section of our docs. The error described in that section doesn't look quite the same as what you're seeing, but perhaps there is a relation of some kind? Could you perhaps try that? If neither of these work, any chance you could provide a minimal reproduction of the issue? We'd be happy to dig in a bit further, but unfortunately the information above isn't enough for us to go on 🙁 |
One other question, @oreoluwadnd: what bundler are you using? If it's Metro, we have a note in our React Native troubleshooting section that may be of use to you about implicitly resolving |
@oreoluwadnd did importing from e.g. |
I'm encountering an issue while setting up Apollo GraphQL with my React Native app.
Here's some context about my setup:
I'm using React Native for my mobile app development.
I'm trying to make simple query to fetch user data.
I've verified that I have installed all the necessary packages and dependencies, including graphql. Here's what I've tried so far:
Checked my package.json to ensure that graphql is listed as a dependency.
Verified that I'm importing graphql correctly in my code.
Despite these efforts, I'm still encountering this error. Could someone please provide guidance on how to resolve this issue? Any insights or suggestions would be greatly appreciated.
Tasks
The text was updated successfully, but these errors were encountered: