React-apollo: (0, _reactApollo2.default) is not a function. (In '(0, _reactApollo2.default)'(MY_QUERY), '(0, _reactApollo2.default)' is undefined

Created on 12 Nov 2017  路  3Comments  路  Source: apollographql/react-apollo

Below is the App.js file I have used for my react-native expo project with Apollo. The last line throws error saying (0, _reactApollo2.default) is not a function. (In '(0, _reactApollo2.default)'(MY_QUERY), '(0, _reactApollo2.default)' is undefined.

App.js file

The AppNavigation file used in the above file is here
The apollo connection is setup and working properly. Is there anything wrong in the above file? Please guide.

Most helpful comment

@KenilDomadia You should change your import statement to

import {graphql} from 'react-apollo'

because graphql is not a default export of react-apollo package

All 3 comments

@KenilDomadia You should change your import statement to

import {graphql} from 'react-apollo'

because graphql is not a default export of react-apollo package

That helped. It was a real silly mistake. Thanks.

This issue has been automatically labled because it has not had recent activity. If you have not received a response from anyone, please mention the repository maintainer (most likely @jbaxleyiii). It will be closed if no further activity occurs. Thank you for your contributions to React Apollo!

Was this page helpful?
0 / 5 - 0 ratings