awslabs / aws-mobile-appsync-sdk-js

JavaScript library files for Offline, Sync, Sigv4. includes support for React Native
Apache License 2.0
921 stars 266 forks source link

Query not working with react-apollo 3.1.5 #605

Open szad769 opened 3 years ago

szad769 commented 3 years ago

Note: If your issue/feature-request/question is regarding the AWS AppSync service, please log it in the official AWS AppSync forum

Do you want to request a feature or report a bug? Report a bug

What is the current behavior?

It is giving me below error

TypeError: this.currentObservable.query.getCurrentResult is not a function. (In 'this.currentObservable.query.getCurrentResult()', 'this.currentObservable.query.getCurrentResult' is undefined)

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. It started giving error when i upgrade react-apollo from version 2.5.8 to 3.15

const { loading, error, data } = useQuery(getListQuery());

It is giving me below `error`

TypeError: this.currentObservable.query.getCurrentResult is not a function. (In 'this.currentObservable.query.getCurrentResult()', 'this.currentObservable.query.getCurrentResult' is undefined)

What is the expected behavior? It should give the result of query

Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions?

My current dependency:

 "aws-appsync": "^4.0.1",
    "aws-appsync-react": "^4.0.1",
    "graphql": "^15.4.0",
    "graphql-tag": "^2.11.0",
    "lodash": "^4.17.20",
    "react": "^16.13.1",
    "react-apollo": "^3.1.5",
moioo91120 commented 2 years ago

Hi, same problem here on apollo 3.4.16

Same error with the documented example.